File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11# Use an official lightweight Node.js image as a parent image
22FROM node:23.6.0-slim
33
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-
114# Set the working directory in the container
125WORKDIR /usr/src/app
136
@@ -20,6 +13,13 @@ RUN npm install
2013# Bundle the source code inside the Docker image
2114COPY . .
2215
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+
20+ # Create a non-root user to run the app
21+ USER nobody
22+
2323
2424# The application will listen on port 8080, so expose it
2525EXPOSE 8080
You can’t perform that action at this time.
0 commit comments