From 22676c6d0319a91a6f52a863c4d2b78e671e55f0 Mon Sep 17 00:00:00 2001 From: Brandon Tsai Date: Sat, 15 Jun 2019 13:44:16 +1000 Subject: [PATCH] #557 - Run as user 'efcuser' --- docker/Dockerfile-prod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile-prod b/docker/Dockerfile-prod index 78151905..cfd2d6a0 100644 --- a/docker/Dockerfile-prod +++ b/docker/Dockerfile-prod @@ -1,6 +1,5 @@ FROM mhart/alpine-node:8.12.0 - ARG REACT_APP_ENV=qa ENV REACT_APP_ENV=${REACT_APP_ENV} @@ -8,11 +7,9 @@ RUN apk update && apk add --no-cache bash py-pip jq RUN npm install -g npm@5.6.0 && npm install -g pm2@latest RUN apk add mysql-client - RUN pip install awscli --upgrade --user && \ echo "export PATH=$PATH:~/.local/bin/" >> ~/.bashrc - COPY ./ /opt/efcsydney-roster/ RUN ls /opt/efcsydney-roster/ WORKDIR /opt/efcsydney-roster @@ -22,6 +19,9 @@ WORKDIR /opt/efcsydney-roster/client RUN yarn ; yarn build ; rm -rf ./node_modules WORKDIR /opt/efcsydney-roster +RUN addgroup -S efcuser && adduser -S efcuser -G efcuser +RUN chown efcuser:efcuser -R /opt/efcsydney-roster +USER efcuser EXPOSE 3000 3001 3002 ENTRYPOINT ["/bin/bash", "-ex", "/opt/efcsydney-roster/docker/Entrypoint.sh", "prod"]