fix: port 80 bind permission error (#1000)

This commit is contained in:
Guy Ben-Aharon
2025-12-09 11:52:39 +02:00
committed by GitHub
parent beeb6c0ae5
commit 5b79c56496
+1 -13
View File
@@ -27,20 +27,8 @@ FROM nginx:stable-alpine AS production
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
COPY ./default.conf.template /etc/nginx/conf.d/default.conf.template
COPY entrypoint.sh /entrypoint.sh
# Set permissions for nginx user to write to necessary directories
RUN chmod +x /entrypoint.sh && \
chown -R nginx:nginx /usr/share/nginx/html && \
chown -R nginx:nginx /etc/nginx/conf.d && \
chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
mkdir -p /var/run/nginx && \
chown -R nginx:nginx /var/run/nginx && \
touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid
RUN chmod +x /entrypoint.sh
EXPOSE 80
USER nginx
ENTRYPOINT ["/entrypoint.sh"]