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

Commit

Permalink
Merge pull request #21 from microservices-demo/docker/user
Browse files Browse the repository at this point in the history
Added user to dockerfile.
  • Loading branch information
Phil Winder authored Nov 8, 2016
2 parents 180a32b + e7b96ea commit bebc6d1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docker/user/Dockerfile-release
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
FROM busybox:1
FROM alpine:3.4

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

ENV HATEAOS user
ENV USER_DATABASE mongodb
ENV MONGO_HOST user-db
Expand All @@ -7,4 +17,10 @@ WORKDIR /
EXPOSE 80
COPY bin/user /

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

USER ${SERVICE_USER}

CMD ["/user", "-port=80"]

0 comments on commit bebc6d1

Please sign in to comment.