Skip to content

Commit abb643f

Browse files
committed
Change Dockerfile to use non-root user
Signed-off-by: Nicko Guyer <[email protected]>
1 parent b201ad7 commit abb643f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
FROM node:16-alpine3.15 as firefly-dataexchange-builder
2-
ADD . /firefly-dataexchange-https
2+
ADD --chown=1001:0 . /firefly-dataexchange-https
33
WORKDIR /firefly-dataexchange-https
4+
RUN mkdir /.npm \
5+
&& chgrp -R 0 /.npm \
6+
&& chmod -R g+rwX /.npm
7+
USER 1001
48
RUN npm install
59
RUN npm run build
610

@@ -12,4 +16,6 @@ COPY --from=firefly-dataexchange-builder /firefly-dataexchange-https/package*.js
1216
RUN npm install --production
1317
EXPOSE 3000
1418
EXPOSE 3001
19+
USER 1001
20+
1521
CMD [ "node", "./build/index.js" ]

0 commit comments

Comments
 (0)