fix: use COPY --chmod instead of RUN chmod in frontend Dockerfile (#214)

The nginx-unprivileged base image runs as non-root, so RUN chmod
on / fails with 'Operation not permitted'. Use COPY --chmod=755
to set the executable bit at build time instead.
This commit is contained in:
Daniel Volz
2026-02-14 21:12:51 +01:00
committed by GitHub
parent d8d8c4a07e
commit c47a35d642
+1 -2
View File
@@ -42,8 +42,7 @@ RUN sed -i 's|include /etc/nginx/conf.d/\*.conf;|include /tmp/default.conf;|' /e
COPY nginx.conf /etc/nginx/templates/default.conf.template
# Copy entrypoint wrapper (translates LOG_LEVEL → nginx access log control)
COPY nginx-entrypoint.sh /nginx-entrypoint.sh
RUN chmod +x /nginx-entrypoint.sh
COPY --chmod=755 nginx-entrypoint.sh /nginx-entrypoint.sh
# Copy built static files with correct ownership (nginx user = uid 101)
COPY --from=builder --chown=101:101 /app/dist /usr/share/nginx/html