Architecture overview
The Docker deployment consists of three containerized services:- Engine (port 8081): Rust-based backtesting engine service
- API (port 8000): FastAPI gateway for HTTP/WebSocket access
- UI (port 8501): Streamlit web interface
Prerequisites
- Docker Engine 20.10+
- Docker Compose 2.0+
- 2GB+ available memory
Quick start
Set environment variables (optional)
Create a If
.env file for API authentication:GLOWBACK_API_KEY is not set, the API will run without authentication.Start all services
- Engine service at
http://localhost:8081 - API gateway at
http://localhost:8000 - Streamlit UI at
http://localhost:8501
Service configuration
Engine service
Dockerfile:docker/engine.Dockerfile
GLOWBACK_ENGINE_ADDR: Bind address for the engine service (default:0.0.0.0:8081)
API service
Dockerfile:docker/api.Dockerfile
GLOWBACK_ENGINE_URL: Internal URL to the engine service (default:http://engine:8081)GLOWBACK_API_KEY: Optional API key for authentication (comma-separated for multiple keys)
UI service
Dockerfile:docker/ui.Dockerfile
GLOWBACK_API_URL: Internal URL to the API gateway (default:http://api:8000)
Common operations
Run in detached mode
View logs
Stop services
Rebuild after code changes
Clean rebuild (remove volumes)
Port mapping
| Service | Internal Port | Host Port | Description |
|---|---|---|---|
| Engine | 8081 | 8081 | gRPC/HTTP engine service |
| API | 8000 | 8000 | FastAPI gateway |
| UI | 8501 | 8501 | Streamlit interface |
docker-compose.yml file:
Production considerations
Security
Resource limits
Add resource constraints todocker-compose.yml:
Persistent data
Mount volumes for data persistence:Health checks
Docker Compose health check example:Troubleshooting
Engine service fails to start
API cannot connect to engine
UI cannot connect to API
Next steps
API setup
Configure the FastAPI gateway
UI setup
Customize the Streamlit interface