We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec16f12 commit e2c33b2Copy full SHA for e2c33b2
1 file changed
Dockerfile
@@ -1,13 +1,6 @@
1
# Use an official lightweight Node.js image as a parent image
2
FROM node:23.6.0-slim
3
4
-# Needed folder to run the app
5
-RUN mkdir /nonexistent && \
6
- chown -R nobody:nogroup /nonexistent
7
-
8
-# Create a non-root user to run the app
9
-USER nobody
10
11
# Set the working directory in the container
12
WORKDIR /usr/src/app
13
@@ -20,6 +13,13 @@ RUN npm install
20
# Bundle the source code inside the Docker image
21
14
COPY . .
22
15
16
+# Needed folder to run the app and set proper permissions
17
+RUN mkdir -p /nonexistent && \
18
+ chown -R nobody:nogroup /nonexistent /usr/src/app
19
+
+# Create a non-root user to run the app
+USER nobody
23
24
# The application will listen on port 8080, so expose it
25
EXPOSE 8080
0 commit comments