Skip to content

Commit 8298bdf

Browse files
committed
Rootless Docker image
1 parent 42c6117 commit 8298bdf

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ prettier.config.js
1111
README.md
1212
vercel.json
1313
vitest.config.ts
14+
dist

.github/README_ARTIFACTHUB.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ An elegant, offline‑first Progressive Web App (PWA) video player. This contain
1313

1414
## Docker Image
1515

16-
- Preconfigured Caddy server serving static files from /srv
16+
- Preconfigured Caddy server serving static files
1717
- Hardened HTTP security headers
18+
- Rootless user
1819
- No volumes or env vars required
1920
- No TLS support (reverse proxy required for production use)
2021
- Expose port 80 in the container

Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,20 @@ RUN pnpm build
3131

3232
FROM caddy:2-alpine
3333

34-
COPY --from=builder /app/dist /srv
34+
RUN adduser \
35+
--gecos "" \
36+
--system \
37+
--no-create-home \
38+
--uid "900" \
39+
"appuser"
3540

36-
COPY Caddyfile /etc/caddy/Caddyfile
41+
USER appuser
42+
43+
COPY --from=builder --chown=appuser:appuser /app/dist /srv
44+
45+
# COPY --chown=appuser:appuser dist /srv
46+
47+
COPY --chown=appuser:appuser Caddyfile /etc/caddy/Caddyfile
3748

3849
EXPOSE 80
3950

0 commit comments

Comments
 (0)