69a232d08a
- FastAPI: POST /api/v1/events, GET /health, JSON Schema validation - PostgreSQL models, Alembic migration, bootstrap API key - deploy/docker-compose.yml, .env.example - docs/install-ubuntu-24.04.md, updated work-plan (agents first)
52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-bookworm
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-sac}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${POSTGRES_DB:-sac}
|
|
volumes:
|
|
- sac_pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-sac} -d ${POSTGRES_DB:-sac}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
api:
|
|
build:
|
|
context: ..
|
|
dockerfile: backend/Dockerfile
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg2://${POSTGRES_USER:-sac}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-sac}
|
|
SAC_PUBLIC_URL: ${SAC_PUBLIC_URL:-http://localhost:8000}
|
|
JWT_SECRET: ${JWT_SECRET:?set JWT_SECRET}
|
|
SAC_BOOTSTRAP_API_KEY: ${SAC_BOOTSTRAP_API_KEY:?set SAC_BOOTSTRAP_API_KEY}
|
|
EVENT_SCHEMA_PATH: /app/schemas/event-schema-v1.json
|
|
CORS_ORIGINS: ${CORS_ORIGINS:-*}
|
|
ports:
|
|
- "${SAC_API_PORT:-8000}:8000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
migrate:
|
|
build:
|
|
context: ..
|
|
dockerfile: backend/Dockerfile
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg2://${POSTGRES_USER:-sac}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-sac}
|
|
command: alembic upgrade head
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
sac_pgdata:
|