From 314f2f3fd213f3eb7e82aee98be6225d1fd79272 Mon Sep 17 00:00:00 2001 From: Sergio Date: Mon, 30 Mar 2026 13:32:37 +0200 Subject: [PATCH] =?UTF-8?q?Corregir=20compose=20producci=C3=B3n=20y=20ngin?= =?UTF-8?q?x.conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- docker-compose.portainer.yml | 24 ++++++------------------ nginx.conf | 3 ++- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/docker-compose.portainer.yml b/docker-compose.portainer.yml index cbb7fcb..7d624ec 100644 --- a/docker-compose.portainer.yml +++ b/docker-compose.portainer.yml @@ -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 diff --git a/nginx.conf b/nginx.conf index eeaf588..3d64c92 100644 --- a/nginx.conf +++ b/nginx.conf @@ -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)