We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1030daa commit 6ec0a82Copy full SHA for 6ec0a82
Dockerfile
@@ -1,17 +1,18 @@
1
FROM node:lts-slim
2
3
-# Create app directory
4
-WORKDIR /usr/src/app
+# switch user
+USER node
5
6
-# Install app dependencies
7
-COPY package*.json ./
8
-RUN npm install
+# Create app directory
+WORKDIR /home/node
9
10
-# Bundle app source
11
-COPY . .
+# Install app dependencies & setup
+COPY --chown=node:node package*.json ./
+RUN npm install --production
12
+COPY --chown=node:node . .
13
14
# Expose
15
EXPOSE 80 443 3000 35729 8080
16
-# Command to run the executable
17
+# Command to run
18
CMD [ "node", "server.js" ]
0 commit comments