fix(docker): set 0755 on web static assets so nginx worker can read

pnpm build under a restrictive umask produces 0600 files; when copied
into nginx:alpine, the non-root nginx worker hits EACCES and serves
403 for every static asset. Force mode via COPY --chmod=0755 (Docker
BuildKit applies uniformly — directories need the exec bit for
traversal, static files don't care about the extra bit).

Closes #761
This commit is contained in:
viettranx committed 2026-04-18 15:34:46 +07:00
1 parent 8fb0300914
commit 2a61365353
1 file changed
+3 -2
+3 -2
View File
@@ -18,8 +18,9 @@ RUN pnpm build
# ── Stage 2: Serve ──
FROM nginx:1.27-alpine
# Copy built assets
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy built assets — force 0755 so the nginx worker (non-root) can read them
# regardless of pnpm's build-time umask (see #761).
COPY --chmod=0755 --from=builder /app/dist /usr/share/nginx/html
# Copy nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf