fix: déploiement pour le frontend

This commit is contained in:
ineszang44
2026-09-21 16:07:43 +02:00
parent 2a7e1c25fc
commit 8386e05f31
4 changed files with 127 additions and 33 deletions
+9 -2
View File
@@ -30,12 +30,19 @@ COPY --chown=root:root nginx.conf /etc/nginx/nginx.conf
RUN chmod 755 /etc/nginx/nginx.conf
# Copy the static build output from the build stage to Nginx's default HTML serving directory
COPY --chown=root:root --from=builder /app/dist/*/browser /usr/share/nginx/html
COPY --chown=root:root --from=builder /app/dist/frontend/browser /usr/share/nginx/html
RUN chmod 755 /usr/share/nginx/html
# Create necessary directories with proper permissions for nginx
RUN mkdir -p /var/log/nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx /var/cache/nginx /usr/share/nginx/html
chown -R nginx:nginx /var/log/nginx /var/cache/nginx /usr/share/nginx/html &&\
chmod 755 /var/log/nginx /var/log
# Permissions appropriées
RUN find /usr/share/nginx/html -type f -exec chmod 644 {} \; && \
find /usr/share/nginx/html -type d -exec chmod 755 {} \; && \
chown -R nginx:nginx /var/log/nginx /var/cache/nginx
# Use a non-root user for security best practices
USER nginx
+3 -4
View File
@@ -1,5 +1,5 @@
worker_processes auto;
error_log /var/log/nginx/error.log warn;
error_log /dev/null warn; # ← Envoyer les logs vers /dev/null
pid /tmp/nginx.pid;
events {
@@ -9,15 +9,14 @@ events {
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/null; # ← Idem pour access logs
sendfile on;
keepalive_timeout 65;
server {
listen 3000;
server_name _;
root /usr/share/nginx/html;
index index.html;
@@ -29,4 +28,4 @@ http {
deny all;
}
}
}
}