Skip to content

Commit

Permalink
Change Dockerfile to use non-root user
Browse files Browse the repository at this point in the history
Signed-off-by: Nicko Guyer <nicko.guyer@kaleido.io>
  • Loading branch information
nguyer committed Jan 10, 2024
1 parent b201ad7 commit abb643f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM node:16-alpine3.15 as firefly-dataexchange-builder
ADD . /firefly-dataexchange-https
ADD --chown=1001:0 . /firefly-dataexchange-https
WORKDIR /firefly-dataexchange-https
RUN mkdir /.npm \
&& chgrp -R 0 /.npm \
&& chmod -R g+rwX /.npm
USER 1001
RUN npm install
RUN npm run build

Expand All @@ -12,4 +16,6 @@ COPY --from=firefly-dataexchange-builder /firefly-dataexchange-https/package*.js
RUN npm install --production
EXPOSE 3000
EXPOSE 3001
USER 1001

CMD [ "node", "./build/index.js" ]

0 comments on commit abb643f

Please sign in to comment.