Spaces:
Running
Running
| version: "3.9" | |
| services: | |
| api: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| image: alami-trash-ai-api:latest | |
| container_name: alami-trash-ai-api | |
| environment: | |
| # Default bundle; override or mount deploy/<version> to /app/deploy/latest | |
| - ALAMI_AI_BUNDLE=/app/deploy/latest | |
| - PORT=8000 | |
| # Optional Supabase integration | |
| # - SUPABASE_URL= | |
| # - SUPABASE_SERVICE_ROLE_KEY= | |
| # - SB_TABLE_PREDICTIONS=trash_predictions | |
| ports: | |
| - "8000:8000" | |
| volumes: | |
| # Mount your local deploy bundle into the container | |
| - ./deploy:/app/deploy:ro | |
| # Persist feedback logs outside the container | |
| - ./feedback_logs:/app/feedback_logs | |
| healthcheck: | |
| test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=3).status==200 else 1)"] | |
| interval: 30s | |
| timeout: 5s | |
| retries: 3 | |
| start_period: 10s | |
| restart: unless-stopped | |
| depends_on: | |
| - db | |
| db: | |
| image: postgres:15 | |
| container_name: alami-trash-ai-db | |
| environment: | |
| - POSTGRES_USER=postgres | |
| - POSTGRES_PASSWORD=postgres | |
| - POSTGRES_DB=postgres | |
| ports: | |
| - "51214:5432" | |
| volumes: | |
| - pg_data:/var/lib/postgresql/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U postgres"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 5 | |
| restart: unless-stopped | |
| volumes: | |
| pg_data: | |