docker compose up --build -dThis builds the image and starts the API on port 8000.
services:
api:
build: .
ports:
- "8000:8000"
volumes:
- ./rootstack.db:/app/rootstack.db
environment:
- BRIDGE_DATABASE_URL=sqlite:///./rootstack.db
- BRIDGE_DEBUG=false
- BRIDGE_LOG_LEVEL=INFO
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 5s
retries: 3docker build -t bridgestack:latest .
docker run -p 8000:8000 -v ./rootstack.db:/app/rootstack.db bridgestack:latest# Development
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Production (multiple workers)
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4pip install gunicorn
gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000The /health endpoint checks database connectivity:
curl http://localhost:8000/healthHealthy response:
{"status": "healthy", "version": "0.3.0", "database": "connected"}Degraded response (database unreachable):
{"status": "degraded", "version": "0.3.0", "database": "unavailable"}Use this endpoint for container orchestration health checks (Docker, Kubernetes).
- Set
BRIDGE_DEBUG=false - Restrict
BRIDGE_CORS_ORIGINSto known domains - Set
BRIDGE_LOG_LEVEL=WARNINGorINFO - Mount the RootStack database file as a volume
- Run behind a reverse proxy (nginx, Caddy) for HTTPS
- Set up log aggregation for structured logs
- Configure container health checks