Commit bebc6d1c authored by Phil Winder's avatar Phil Winder Committed by GitHub
Browse files

Merge pull request #21 from microservices-demo/docker/user

Added user to dockerfile.
parents 180a32bb e7b96ea0
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
......@@ -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"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment