Skip to content

Commit e2c33b2

Browse files
committed
chore: fix permission issue in dockerfile
1 parent ec16f12 commit e2c33b2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# Use an official lightweight Node.js image as a parent image
22
FROM 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
125
WORKDIR /usr/src/app
136

@@ -20,6 +13,13 @@ RUN npm install
2013
# Bundle the source code inside the Docker image
2114
COPY . .
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
2525
EXPOSE 8080

0 commit comments

Comments
 (0)