Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Clean and ensure file is owned by the correct user.
Browse files Browse the repository at this point in the history
  • Loading branch information
philwinder committed Nov 7, 2016
1 parent 744b4d7 commit be326bc
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions docker/catalogue/Dockerfile-release
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
FROM alpine:3.4

RUN addgroup mygroup && adduser -D -G mygroup myuser
RUN apk add --update libcap
ENV SERVICE_USER=myuser \
SERVICE_UID=10001 \
SERVICE_GROUP=mygroup \
SERVICE_GID=10001

RUN addgroup -g ${SERVICE_GID} ${SERVICE_GROUP} && \
adduser -g "${SERVICE_NAME} user" -D -H -G ${SERVICE_GROUP} -s /sbin/nologin -u ${SERVICE_UID} ${SERVICE_USER} && \
apk add --update libcap

WORKDIR /
EXPOSE 80
COPY app /
COPY images/ /images/

RUN setcap 'cap_net_bind_service=+ep' /app
USER myuser
RUN chmod +x /app && \
chown -R ${SERVICE_USER}:${SERVICE_GROUP} /app /images && \
setcap 'cap_net_bind_service=+ep' /app

USER ${SERVICE_USER}

ARG BUILD_DATE
ARG BUILD_VERSION
Expand Down

0 comments on commit be326bc

Please sign in to comment.