Files
Aurora-Core/docker-compose.yml
T

98 lines
2.5 KiB
YAML
Raw Normal View History

2026-09-04 17:34:03 -05:00
# Local development environment. For a production-shaped topology
# (PgBouncer, multiple API replicas, Traefik) see docker-compose.prod.yml.
name: aurora-core
services:
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: aurora
POSTGRES_PASSWORD: aurora
POSTGRES_DB: aurora_core
ports:
- "5432:5432"
volumes:
- aurora_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U aurora -d aurora_core"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
migrate:
build:
context: .
dockerfile: docker/api.Dockerfile
env_file: .env
environment:
DATABASE_URL_SYNC: postgresql+psycopg2://aurora:aurora@postgres:5432/aurora_core
depends_on:
postgres:
condition: service_healthy
entrypoint: ["alembic"]
command: ["upgrade", "head"]
api:
build:
context: .
dockerfile: docker/api.Dockerfile
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgresql+asyncpg://aurora:aurora@postgres:5432/aurora_core
DATABASE_URL_SYNC: postgresql+psycopg2://aurora:aurora@postgres:5432/aurora_core
REDIS_URL: redis://redis:6379/0
MEDIA_ROOT: /app/media
2026-09-04 17:34:03 -05:00
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
command:
["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
volumes:
- ./app:/app/app
- aurora_media_data:/app/media
2026-09-04 17:34:03 -05:00
worker:
build:
context: .
dockerfile: docker/worker.Dockerfile
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgresql+asyncpg://aurora:aurora@postgres:5432/aurora_core
DATABASE_URL_SYNC: postgresql+psycopg2://aurora:aurora@postgres:5432/aurora_core
REDIS_URL: redis://redis:6379/0
MEDIA_ROOT: /app/media
2026-09-04 17:34:03 -05:00
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
volumes:
- ./app:/app/app
- aurora_media_data:/app/media
2026-09-04 17:34:03 -05:00
volumes:
aurora_postgres_data:
aurora_media_data: