infrastructure/docker-compose.yml. The recommended way to start everything is the helper script scripts/devops/start_stack.sh, which runs pre-flight checks and post-deployment health verification automatically.
Services overview
| Service | Container | Host port | Description |
|---|---|---|---|
| FastAPI backend | sa_api | 8000 | Python API server, RAG engine, LLM orchestration |
| ChromaDB | sa_chromadb | 8001 | Vector store for the knowledge base |
| Ollama | sa_ollama | 11434 | Local LLM runtime (optional for cloud mode) |
sa_network bridge (172.25.0.0/16) and are never directly exposed to the internet.
Deploying the stack
Create your .env file
Copy the template from the repository root and edit it to match your setup:At minimum, set
LLM_PROVIDER to your preferred backend (gemini, groq, or ollama) and supply the corresponding API key if using a cloud provider. See Environment configuration for all available variables.Start the stack
Run the helper script from the repository root:The script performs the following steps automatically:
- Runs
infrastructure/pre_check.py(pre-flight validation) - Creates
.envfrom.env.exampleif it does not yet exist - Pulls the latest Docker images:
docker compose --env-file .env -f infrastructure/docker-compose.yml pull - Builds and starts containers:
docker compose --env-file .env -f infrastructure/docker-compose.yml up -d --build - Waits 5 seconds for services to initialise
- Runs
infrastructure/verify_setup.py(post-deployment health checks)
On the first run, Docker must pull the base images and build the API container. This typically takes 2–5 minutes depending on your connection speed. Subsequent starts are significantly faster.
Service endpoints
Once the stack is operational, the following URLs are available on your local machine:| URL | Service |
|---|---|
http://localhost:8000 | FastAPI backend |
http://localhost:8000/docs | Interactive API documentation (Swagger UI) |
http://localhost:8001 | ChromaDB REST API |
http://localhost:11434 | Ollama API |
Viewing logs
Stopping the stack
docker compose --env-file .env -f infrastructure/docker-compose.yml down, which stops and removes the containers while preserving all volumes (ChromaDB index, Ollama model weights).
To perform a full reset that also removes volumes:
Data persistence and volumes
| Volume / bind mount | Container path | Purpose |
|---|---|---|
./data/logs | /app/logs (sa_api) | API server logs |
../src/server/app | /app/app (sa_api) | Live-reload source mount |
../packages/knowledge_base | /app/knowledge_base (sa_api) | RAG knowledge base files |
./chroma_data | /data (sa_chromadb) | ChromaDB persistent index |
ollama_data (named volume) | /root/.ollama (sa_ollama) | Downloaded model weights |
Health checks
All three services include Docker health checks so that dependent services start in the correct order:| Container | Health check method | Interval | Retries |
|---|---|---|---|
sa_api | TCP connect to port 8000 | 10 s | 3 |
sa_chromadb | TCP connect to port 8000 (internal) | 10 s | 3 |
sa_ollama | TCP connect to port 11434 | 10 s | 3 (30 s start period) |
sa_api container will not start until both sa_chromadb and sa_ollama report healthy.