Aggiunge proxy edge con pagina di cortesia e rilascio a downtime minimo.

NPM punta a nginx locale su :3000 che resta attivo durante il restart Rails; nuovo script release_production.sh esegue migrate, build e deploy in ordine.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-13 09:31:36 +02:00
parent 208664848e
commit 949a0a01fb
6 changed files with 316 additions and 21 deletions

View File

@@ -52,9 +52,7 @@ services:
context: ../backend
dockerfile: Dockerfile
restart: unless-stopped
command: >
bash -c "bundle exec rails db:prepare &&
bundle exec rails server -b 0.0.0.0 -p 3000 -e production"
command: bundle exec rails server -b 0.0.0.0 -p 3000 -e production
environment:
RAILS_ENV: production
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/matchlivetv
@@ -117,8 +115,6 @@ services:
OPS_SIDEKIQ_STALE_SECS: ${OPS_SIDEKIQ_STALE_SECS:-300}
OPS_LOG_SUBSCRIBER: ${OPS_LOG_SUBSCRIBER:-false}
SENTRY_DSN: ${SENTRY_DSN:-}
ports:
- "3000:3000" # Solo LAN — NPM proxy HTTPS
depends_on:
postgres:
condition: service_healthy
@@ -139,6 +135,20 @@ services:
retries: 10
start_period: 90s
edge:
image: nginx:alpine
restart: unless-stopped
ports:
- "3000:80" # Solo LAN — NPM proxy HTTPS (pagina cortesia se Rails è in restart)
volumes:
- ./nginx-edge/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx-edge/maintenance.html:/usr/share/nginx/maintenance/index.html:ro
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:80/edge-health"]
interval: 15s
timeout: 5s
retries: 3
sidekiq:
build:
context: ../backend