- FastAPI app with SPAStaticFiles catch-all (root_path NOT in constructor)
- config.py with DATA_PATH, PROMPTS_PATH, OUTPUTS_PATH, CAMPAIGNS_PATH, CONFIG_PATH
- Startup lifespan creates data directories automatically
- Health endpoint: GET /api/health -> {"status": "ok"}
- Dockerfile multi-stage: node:22-slim builds React, python:3.12-slim serves API+SPA
- --root-path /postgenerator set in Uvicorn CMD only (avoids Pitfall #4)
- docker-compose.yml: lab-postgenerator-app, proxy_net, named volume for data persistence
- requirements.txt with pinned versions: fastapi[standard]==0.135.1, anthropic==0.84.0
27 lines
503 B
YAML
27 lines
503 B
YAML
services:
|
|
app:
|
|
container_name: lab-postgenerator-app
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
env_file: .env
|
|
volumes:
|
|
- postgenerator-data:/app/data
|
|
networks:
|
|
- proxy_net
|
|
# NO exposed ports — traffic routed via lab-router nginx
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 1024M
|
|
cpus: '1.0'
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgenerator-data:
|
|
name: postgenerator-data
|
|
|
|
networks:
|
|
proxy_net:
|
|
external: true
|