38 lines
930 B
YAML
38 lines
930 B
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: app
|
|
POSTGRES_PASSWORD: app
|
|
POSTGRES_DB: app
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U app"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
app:
|
|
build: .
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://app:app@db:5432/app
|
|
SECRET_KEY: dev-secret-change-me-in-production
|
|
AUTO_CREATE_TABLES: "true"
|
|
FIRST_SUPERUSER_EMAIL: admin@example.com
|
|
FIRST_SUPERUSER_PASSWORD: changethis
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
# Seed default roles/permissions/superuser, then start the server.
|
|
command: >
|
|
sh -c "uv run python -m scripts.seed &&
|
|
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000"
|
|
|
|
volumes:
|
|
pgdata:
|