feat: Docker multi-stage build (Node build + nginx static serve)

This commit is contained in:
2026-02-22 20:04:08 +01:00
parent a4c4ac9e51
commit 1b09106aed
4 changed files with 98 additions and 0 deletions

35
nginx.conf Normal file
View File

@@ -0,0 +1,35 @@
server {
listen 3000;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Compression gzip
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml;
# Cache statique long (JS/CSS hachés par Next.js)
location /_next/static/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Cache modéré pour les autres assets
location ~* \.(ico|png|jpg|jpeg|gif|svg|webp|woff2?|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public";
}
# SPA fallback : toutes les routes renvoient index.html
location / {
try_files $uri $uri/ /index.html;
}
# Pas de log pour favicon/robots
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; }
}