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)