Backend (replaces PHP api.php + auth.php): - FastAPI app with routers: jobs, auth, billing - Supabase JWT authentication in deps.py - Celery + Redis job queue (process_pdf_task) - MinIO S3-compatible storage service - PDF checker wrapper (delegates to enterprise_pdf_checker.py) - Stripe billing: checkout, portal, webhook handler Multi-tenancy (Phase 3): - Alembic migration 001: workspaces, workspace_members, jobs, usage_events - Row-Level Security on all tenant tables via app.workspace_id session var - Monthly quota enforcement per workspace (402 on exceeded) - Plan tiers: free(5) / pro(100) / business(unlimited) Config: - pydantic-settings based config.py (no hardcoded values) - docker-compose.yml rewritten: postgres, redis, minio, api, celery Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
73 lines
1.7 KiB
YAML
73 lines
1.7 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: ${DB_NAME:-pdf_accessibility}
|
|
POSTGRES_USER: ${DB_USER:-pdf_accessibility}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-pdf_accessibility}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
|
|
minio:
|
|
image: minio/minio:latest
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: ${STORAGE_ACCESS_KEY:-minioadmin}
|
|
MINIO_ROOT_PASSWORD: ${STORAGE_SECRET_KEY:-minioadmin}
|
|
volumes:
|
|
- minio_data:/data
|
|
ports:
|
|
- "9000:9000"
|
|
- "9001:9001"
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: backend/Dockerfile
|
|
environment:
|
|
- DB_HOST=postgres
|
|
- REDIS_URL=redis://redis:6379/0
|
|
- STORAGE_ENDPOINT=http://minio:9000
|
|
env_file: .env
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
celery:
|
|
build:
|
|
context: .
|
|
dockerfile: backend/Dockerfile
|
|
command: uv run celery -A app.services.queue.celery_app worker --loglevel=info -c 2
|
|
environment:
|
|
- DB_HOST=postgres
|
|
- REDIS_URL=redis://redis:6379/0
|
|
- STORAGE_ENDPOINT=http://minio:9000
|
|
env_file: .env
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
postgres_data:
|
|
minio_data:
|