Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Dockerfile to use non-root user #76

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" ]
Loading