Skip to content

Commit 0d82ca6

Browse files
committed
fix: solve nginx conflict
1 parent 6c8565f commit 0d82ca6

File tree

4 files changed

+12
-32
lines changed

4 files changed

+12
-32
lines changed

docs-page/Dockerfile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
FROM nginx:1.25-alpine
1+
# nginx:unprivileged runs as non-root (UID 101) on port 8080 — no permission hacks needed
2+
FROM nginxinc/nginx-unprivileged:1.25-alpine
23

3-
# Copy Swagger UI docs page
44
COPY index.html /usr/share/nginx/html/index.html
55
COPY logo.png /usr/share/nginx/html/logo.png
6-
7-
# Copy nginx configuration
86
COPY nginx.conf /etc/nginx/conf.d/default.conf
97

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-
16-
USER nginx
17-
18-
EXPOSE 80
8+
EXPOSE 8080
199

2010
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
21-
CMD wget -qO- http://localhost/health || exit 1
11+
CMD wget -qO- http://localhost:8080/health || exit 1

docs-page/nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
server {
2-
listen 80;
3-
listen [::]:80;
2+
listen 8080;
3+
listen [::]:8080;
44
server_name _;
55

66
root /usr/share/nginx/html;

status-page/Dockerfile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
FROM nginx:1.25-alpine
1+
# nginx:unprivileged runs as non-root (UID 101) on port 8080 — no permission hacks needed
2+
FROM nginxinc/nginx-unprivileged:1.25-alpine
23

3-
# Copy static status page
44
COPY index.html /usr/share/nginx/html/index.html
55
COPY logo.png /usr/share/nginx/html/logo.png
6-
7-
# Copy nginx configuration
86
COPY nginx.conf /etc/nginx/conf.d/default.conf
97

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-
16-
USER nginx
17-
18-
EXPOSE 80
8+
EXPOSE 8080
199

2010
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
21-
CMD wget -qO- http://localhost/health || exit 1
11+
CMD wget -qO- http://localhost:8080/health || exit 1

status-page/nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
server {
2-
listen 80;
3-
listen [::]:80;
2+
listen 8080;
3+
listen [::]:8080;
44
server_name _;
55

66
root /usr/share/nginx/html;

0 commit comments

Comments
 (0)