Skip to content

Commit 6c8565f

Browse files
committed
fix: solve permission deny issue
1 parent 27e7559 commit 6c8565f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs-page/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ COPY logo.png /usr/share/nginx/html/logo.png
77
# Copy nginx configuration
88
COPY nginx.conf /etc/nginx/conf.d/default.conf
99

10+
# Grant nginx user write access to runtime directories before dropping root
11+
RUN mkdir -p /var/cache/nginx /var/run /var/log/nginx \
12+
&& chown -R nginx:nginx /var/cache/nginx /var/run /var/log/nginx \
13+
&& touch /var/run/nginx.pid \
14+
&& chown nginx:nginx /var/run/nginx.pid
15+
1016
USER nginx
1117

1218
EXPOSE 80

status-page/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ COPY logo.png /usr/share/nginx/html/logo.png
77
# Copy nginx configuration
88
COPY nginx.conf /etc/nginx/conf.d/default.conf
99

10+
# Grant nginx user write access to runtime directories before dropping root
11+
RUN mkdir -p /var/cache/nginx /var/run /var/log/nginx \
12+
&& chown -R nginx:nginx /var/cache/nginx /var/run /var/log/nginx \
13+
&& touch /var/run/nginx.pid \
14+
&& chown nginx:nginx /var/run/nginx.pid
15+
1016
USER nginx
1117

1218
EXPOSE 80

0 commit comments

Comments
 (0)