Skip to content

Commit

Permalink
Merge pull request #76 from kaleido-io/non-root-user
Browse files Browse the repository at this point in the history
Change Dockerfile to use non-root user
  • Loading branch information
gabriel-indik authored Feb 20, 2024
2 parents b201ad7 + abb643f commit cbf34b6
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 cbf34b6

Please sign in to comment.