We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee37561 commit 76741baCopy full SHA for 76741ba
1 file changed
Dockerfile
@@ -1,16 +1,24 @@
1
-FROM node:alpine
+FROM node:alpine as base
2
3
WORKDIR /usr/src/app
4
5
-COPY package*.json .
6
-COPY dist dist
+COPY . .
7
8
-RUN npm install --ignore-scripts
+RUN npm ci
9
10
-EXPOSE 9000
+RUN npm run build
+
11
+FROM node:alpine
12
13
+WORKDIR /usr/src/app
14
15
ENV PORT=""
16
ENV TARGET=""
17
ENV EXPIRY=""
18
19
+COPY --from=base --chown=nobody:nogroup /usr/src/app/dist dist
20
+COPY --from=base --chown=nobody:nogroup /usr/src/app/node_modules node_modules
21
+USER nobody
22
+EXPOSE 9000
23
24
CMD sh -c "node dist/index.js --port $PORT --target $TARGET --expiry $EXPIRY"
0 commit comments