- Copy the environment template:
cp .env.example .env-
Edit
.envand set a uniqueJWT_SECRET_KEYand database password. -
Start the stack:
docker compose up --buildServices:
- FastAPI:
http://localhost:8000 - Swagger/OpenAPI:
http://localhost:8000/docs - Streamlit dashboard:
http://localhost:8501 - PostgreSQL:
localhost:5432
The FastAPI service installs requirements-backend.txt. The Streamlit service installs requirements.txt so the existing demo remains lightweight.
When SAFEVISION_BACKEND_SYNC=true, Streamlit sends newly detected safety events to FastAPI:
Streamlit dashboard -> FastAPI /api/v1/detection/ -> PostgreSQL
Inside Docker Compose, Streamlit reaches the API at http://api:8000. For local non-Docker Streamlit runs, use SAFEVISION_API_URL=http://localhost:8000.