Docker Deployment¶
WikiMind provides Docker Compose configurations for both local development and production deployment.
Development Stack¶
The development stack mounts your source code for hot-reloading:
Services:
| Service | Description | Port |
|---|---|---|
gateway | FastAPI app with uvicorn (hot-reload) | 7842 |
worker | ARQ background job worker | -- |
redis | Job queue broker | 6379 |
docling | PDF extraction sidecar | 5001 |
Data is persisted in Docker volumes (wikimind-data, wikimind-redis).
Development commands¶
make docker-build # Build the dev image
make docker-up # Start the stack (uses cached image)
make docker-up-build # Rebuild and start
make docker-logs # Tail logs from all services
make docker-down # Stop and remove the stack
The dev stack uses docker-compose.yml which mounts ./src and ./tests into the container, so code changes are reflected immediately.
Production Stack¶
The production stack runs a complete deployment with PostgreSQL:
Set a strong password
Always set POSTGRES_PASSWORD to a strong, unique value. The compose file refuses to start without it.
Services¶
| Service | Description | Port | Resources |
|---|---|---|---|
gateway | FastAPI app with gunicorn | 7842 | 2 CPU, 1GB |
worker | ARQ background worker | -- | 1 CPU, 1GB |
postgres | PostgreSQL 16 | -- | 1 CPU, 1GB |
redis | Job queue broker | -- | 0.5 CPU, 512MB |
docling | PDF extraction sidecar | 5001 | 2 CPU, 4GB |
Configuration¶
All production settings are sourced from .env or shell environment:
# Required
POSTGRES_PASSWORD=your-strong-password
# Optional (with defaults shown)
POSTGRES_USER=wikimind
POSTGRES_DB=wikimind
WIKIMIND_PORT=7842
WIKIMIND_IMAGE=wikimind:latest
Gunicorn workers auto-tune to available CPU cores (see gunicorn.conf.py). Override with:
Production commands¶
make deploy-up # Build and start the production stack
make deploy-stop # Stop the production stack (preserves data)
make deploy-logs # Tail logs from all services
make deploy-ps # Show service status
PostgreSQL tuning¶
The production Postgres container is configured with:
max_connections=100shared_buffers=128MBwork_mem=4MBstatement_timeout=60sidle_in_transaction_session_timeout=120s
Data is persisted in the wikimind-pgdata volume.
Health checks¶
All services have health checks configured:
- Gateway:
GET /healthevery 10s (60s start period) - Worker: Depends on gateway health
- Postgres:
pg_isreadyevery 10s (15s start period) - Redis:
redis-cli pingevery 10s - Docling:
GET /healthevery 30s
Scaling¶
The production compose file supports horizontal scaling for the gateway:
No container_name is set on the gateway service to allow this.
LLM API Keys¶
Pass LLM API keys via .env file or environment variables. The compose files include:
So any keys in your .env are automatically available to the gateway and worker.
Networking¶
The production stack uses a dedicated wikimindnet bridge network. Services communicate via Docker DNS (e.g., postgres:5432, redis:6379).
The development stack uses Docker Compose's default network.