Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
fix: non-root user in Dockerfile (#496)
Browse files Browse the repository at this point in the history
* fix: non-root user in Dockerfile

* fix: add user

* fix: change commands to work for alpine
  • Loading branch information
Dino Rodriguez authored Jun 12, 2020
1 parent ec22205 commit fb6d05b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ WORKDIR /opt/payid

COPY . .

# create a group and user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup

# postgresql-client is needed if/when we run "wait-for-postgres.sh" (in ./scripts) to make sure Postgres is ready to execute SQL scripts.
RUN apk --no-cache add postgresql-client~=12 &&\
npm cache clean --force &&\
npm install &&\
npm run build &&\
ls -al /opt/payid/build/ &&\
ls -al /opt/payid/build/src
npm run build

EXPOSE 8080 8081

CMD ["node", "/opt/payid/build/src/index.js"]
# run all future commands as this user
USER appuser

CMD ["node", "/opt/payid/build/src/index.js"]

0 comments on commit fb6d05b

Please sign in to comment.