Files
techxcar/docker-compose.prod.yml
T
Luciano Milani 5de37bb512 Inicial
2026-07-02 12:47:55 +01:00

77 lines
1.8 KiB
YAML

services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- backend-net
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- backend-net
backend:
image: ${BACKEND_IMAGE:-techxcar-backend:latest}
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
APP_ENV: production
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- pdf_storage:/app/storage
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/api/v1/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- backend-net
- frontend-net
frontend:
image: ${FRONTEND_IMAGE:-techxcar-frontend:latest}
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
networks:
- frontend-net
volumes:
postgres_data:
redis_data:
pdf_storage:
networks:
backend-net:
driver: bridge
frontend-net:
driver: bridge