docker-compose.yml
yaml
| 1 | services: |
| 2 | musehub: |
| 3 | build: . |
| 4 | container_name: musehub |
| 5 | ports: |
| 6 | - "10003:10003" |
| 7 | env_file: .env |
| 8 | environment: |
| 9 | DATABASE_URL: "postgresql+asyncpg://musehub:${DB_PASSWORD:-musehub}@postgres:5432/musehub" |
| 10 | volumes: |
| 11 | - musehub_data:/data |
| 12 | depends_on: |
| 13 | postgres: |
| 14 | condition: service_healthy |
| 15 | restart: unless-stopped |
| 16 | |
| 17 | postgres: |
| 18 | image: postgres:16-alpine |
| 19 | container_name: musehub_postgres |
| 20 | environment: |
| 21 | POSTGRES_DB: musehub |
| 22 | POSTGRES_USER: musehub |
| 23 | POSTGRES_PASSWORD: "${DB_PASSWORD:-musehub}" |
| 24 | volumes: |
| 25 | - postgres_data:/var/lib/postgresql/data |
| 26 | healthcheck: |
| 27 | test: ["CMD-SHELL", "pg_isready -U musehub -d musehub"] |
| 28 | interval: 5s |
| 29 | timeout: 5s |
| 30 | retries: 10 |
| 31 | restart: unless-stopped |
| 32 | # Expose on 5434 (not 5432/5433) to avoid colliding with a locally-installed |
| 33 | # Postgres or another project's container (e.g. agentception uses 5433). |
| 34 | # This lets the local test suite and Alembic CLI reach the DB directly: |
| 35 | # DATABASE_URL=postgresql+asyncpg://musehub:musehub@localhost:5434/musehub |
| 36 | # make test (the Makefile sets this automatically) |
| 37 | # alembic upgrade head |
| 38 | ports: |
| 39 | - "127.0.0.1:5434:5432" |
| 40 | |
| 41 | volumes: |
| 42 | musehub_data: |
| 43 | postgres_data: |