The production deploy failed because port 3000 was already bound by the dev frontend container (bilhej-frontend). The prod frontend doesn't need a host port at all — nginx talks to it via the external 'web' network. Changes: - Remove host port binding (3000:80) from prod frontend - Remove unused 'certs' volume from prod compose - Use --project-name bilhej-prod in deploy workflow to isolate prod containers/networks from dev and e2e environments - Add 'docker compose down' before 'up' for clean deploys - Update health check network names to bilhej-prod_default
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16
|
|
container_name: bilhej-postgres-prod
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
volumes:
|
|
- pgdata-prod:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
backend:
|
|
build:
|
|
dockerfile: docker/backend.prod.Dockerfile
|
|
context: .
|
|
container_name: bilhej-backend-prod
|
|
environment:
|
|
SPRING_PROFILES_ACTIVE: docker
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
JWT_SECRET: ${JWT_SECRET}
|
|
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
|
|
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET}
|
|
STRIPE_PRICE_ID: ${STRIPE_PRICE_ID}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
frontend:
|
|
build:
|
|
dockerfile: docker/frontend.prod.Dockerfile
|
|
context: .
|
|
container_name: bilhej-frontend-prod
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- default
|
|
- web
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata-prod:
|
|
|
|
networks:
|
|
web:
|
|
external: true
|