Corregir compose producción y nginx.conf
- nginx.conf: eliminar text/html de gzip_types (duplicado con default de nginx) - compose: webroot apunta a /var/volumes/web_jailgames directamente - compose: conf nginx montada como jailgames.conf (no default.conf) para evitar que el entrypoint la sobreescriba al arrancar - healthcheck: usar pgrep nginx en lugar de wget (más fiable) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,11 @@ services:
|
||||
image: nginx:alpine
|
||||
|
||||
volumes:
|
||||
- jailgames-html:/usr/share/nginx/html:ro
|
||||
- jailgames-nginx:/etc/nginx/conf.d:ro
|
||||
# Contenido del sitio: copiar aquí el resultado de "npm run build" (_site/)
|
||||
- /var/volumes/web_jailgames:/usr/share/nginx/html:ro
|
||||
# Configuración Nginx: copiar nginx.conf del repo aquí con nombre jailgames.conf
|
||||
# No se llama default.conf para evitar que el entrypoint de nginx lo modifique
|
||||
- /var/volumes/web_jailgames-nginx/jailgames.conf:/etc/nginx/conf.d/jailgames.conf:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
|
||||
@@ -23,7 +26,7 @@ services:
|
||||
- traefik.http.services.jailgames.loadbalancer.server.port=80
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost/"]
|
||||
test: ["CMD", "pgrep", "nginx"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
@@ -31,21 +34,6 @@ services:
|
||||
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
jailgames-html:
|
||||
driver: local
|
||||
driver_opts:
|
||||
o: bind
|
||||
type: none
|
||||
device: /var/volumes/web_jailgames/html
|
||||
|
||||
jailgames-nginx:
|
||||
driver: local
|
||||
driver_opts:
|
||||
o: bind
|
||||
type: none
|
||||
device: /var/volumes/web_jailgames/nginx
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
|
||||
+2
-1
@@ -6,8 +6,9 @@ server {
|
||||
index index.html;
|
||||
|
||||
# Compresión para HTML/CSS/JS
|
||||
# text/html ya está incluido por defecto en nginx, no repetir
|
||||
gzip on;
|
||||
gzip_types text/html text/css application/javascript application/json image/svg+xml;
|
||||
gzip_types text/css application/javascript application/json image/svg+xml;
|
||||
gzip_min_length 256;
|
||||
|
||||
# Cacheo para assets estáticos (feria local)
|
||||
|
||||
Reference in New Issue
Block a user