Skip to content

Commit dce6e0e

Browse files
committed
feat: use nginx-unprivileged image for container security
Cherry-picked from upstream PR CorentinTh#1499 (ombre8): - Switch to nginxinc/nginx-unprivileged (runs as non-root user) - Listen on port 8080 instead of 80 - Combined with PR CorentinTh#1796: pinned to 1.31-alpine for CVE-2026-42945 fix - Update README docker run examples
2 parents 316d1f8 + f02a028 commit dce6e0e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ COPY . .
1010
RUN pnpm build
1111

1212
# production stage
13-
FROM nginx:1.31-alpine AS production-stage
13+
FROM nginxinc/nginx-unprivileged:1.31-alpine AS production-stage
1414
COPY --from=build-stage /app/dist /usr/share/nginx/html
1515
COPY nginx.conf /etc/nginx/conf.d/default.conf
16-
EXPOSE 80
16+
EXPOSE 8080
1717
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Self host solutions for your homelab
2121
**From docker hub:**
2222

2323
```sh
24-
docker run -d --name it-tools --restart unless-stopped -p 8080:80 corentinth/it-tools:latest
24+
docker run -d --name it-tools --restart unless-stopped -p 8080:8080 corentinth/it-tools:latest
2525
```
2626

2727
**From github packages:**
2828

2929
```sh
30-
docker run -d --name it-tools --restart unless-stopped -p 8080:80 ghcr.io/corentinth/it-tools:latest
30+
docker run -d --name it-tools --restart unless-stopped -p 8080:8080 ghcr.io/corentinth/it-tools:latest
3131
```
3232

3333
**Other solutions:**

nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
server {
2-
listen 80;
2+
listen 8080;
33
server_name localhost;
44
root /usr/share/nginx/html;
55
index index.html;
66

77
location / {
88
try_files $uri $uri/ /index.html;
99
}
10-
}
10+
}

0 commit comments

Comments
 (0)