docker-compose.yml
Rama main · réplica de lectura del repositorio original.
name: croesus
services:
backend:
build:
context: ./backend
target: production
container_name: croesus-backend
restart: unless-stopped
environment:
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-croesus}:${POSTGRES_PASSWORD:?database password required}@postgres:5432/${POSTGRES_DB:-croesus}
CORS_ORIGINS: ${CORS_ORIGINS:-["http://localhost:8080"]}
ADMIN_USERNAME: ${ADMIN_USERNAME:-}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-}
JWT_SECRET: ${JWT_SECRET:-}
OIDC_ISSUER: ${OIDC_ISSUER:-}
OIDC_CLIENT_ID: ${OIDC_CLIENT_ID:-}
OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET:-}
OIDC_REDIRECT_URI: ${OIDC_REDIRECT_URI:-}
OIDC_DISPLAY_NAME: ${OIDC_DISPLAY_NAME:-}
PRICE_REFRESH_ENABLED: ${PRICE_REFRESH_ENABLED:-true}
PRICE_REFRESH_INTERVAL_MINUTES: ${PRICE_REFRESH_INTERVAL_MINUTES:-360}
PRICE_CACHE_TTL_MINUTES: ${PRICE_CACHE_TTL_MINUTES:-5}
ports:
- "${BACKEND_PORT:-8000}:8000"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')\""]
interval: 10s
timeout: 5s
retries: 5
networks:
- internal
postgres:
image: postgres:16-alpine
container_name: croesus-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-croesus}
POSTGRES_USER: ${POSTGRES_USER:-croesus}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?database password required}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-croesus} -d ${POSTGRES_DB:-croesus}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- internal
frontend:
build:
context: ./frontend
args:
VITE_API_URL: ${API_URL:-http://localhost:8000}
container_name: croesus-frontend
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-8080}:80"
networks:
- internal
volumes:
postgres_data:
networks:
internal:
driver: bridge