Skip to content

Commit

Permalink
Merge pull request #438 from bcgov/bug/node-root-user
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
barrfalk authored Dec 13, 2023
2 parents 21620f5 + ee62af5 commit 07c803b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM docker.io/node:16.15.0-alpine

ENV NO_UPDATE_NOTIFIER=true
ENV NPM_CONFIG_CACHE=/opt/app-root/src/app/.npm-cache

WORKDIR /opt/app-root/src/app
COPY . /opt/app-root/src
RUN npm run all:ci \
&& npm run all:build \
&& npm run client:purge
EXPOSE 8000

# Switch to a non-root user with UID 1001 and GID 1001
USER 1001:1001

RUN npm run all:ci \
&& npm run all:build \
&& npm run client:purge

EXPOSE 8000
CMD ["npm", "run", "start"]

0 comments on commit 07c803b

Please sign in to comment.