Deployment¶
Docker¶
The standard, full, and agent presets generate a Dockerfile and docker-compose.yml.
Dockerfile¶
FROM python:3.12-slim
WORKDIR /app
COPY pyproject.toml .
RUN pip install -e ".[db-postgres,auth-jwt]"
COPY . .
CMD ["fastagentstack", "run"]
Docker Compose¶
Environment Variables¶
All settings map to environment variables. Set DATABASE_URL, REDIS_URL, and SECRET_KEY at minimum:
DATABASE_URL=postgresql+asyncpg://user:pass@db/myapp
REDIS_URL=redis://redis:6379
SECRET_KEY=your-secret-key-here
Use a .env file locally; inject via your platform in production.
Production Server¶
fastagentstack run calls uvicorn.run() with multi-worker mode and binds to 0.0.0.0.
Kubernetes¶
The full and agent presets can generate K8s manifests with include_k8s=true:
Update configmap.yaml with your environment variables, then:
Health Checks¶
Use the built-in health endpoints for readiness/liveness probes:
livenessProbe:
httpGet:
path: /health/live
port: 8000
readinessProbe:
httpGet:
path: /health/ready
port: 8000
/health/live → always 200 (process is up).
/health/ready → 200 if DB + Redis are reachable, 503 otherwise.
Secrets Management¶
AWS Secrets Manager¶
export SECRETS_BACKEND=aws
export SECRETS_AWS_SECRET_ID=myapp/prod
export SECRETS_AWS_REGION=us-east-1
GCP Secret Manager¶
Secrets are merged with env vars; env vars take precedence.
Migrations at Deploy Time¶
Run migrations as a pre-deploy step or init container:
This is idempotent — safe to run on every deploy.