Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 896 Bytes

docker.md

File metadata and controls

34 lines (22 loc) · 896 Bytes

Docker Guide

  1. Copy the environment template:
cp .env.example .env
  1. Edit .env and set a unique JWT_SECRET_KEY and database password.

  2. Start the stack:

docker compose up --build

Services:

  • 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.

Streamlit Backend Sync

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.