Docker & Local Development
Local Development Environment
The backend includes a Docker Compose setup for local development in backend/infrastructure/dev/docker-compose.yaml.
What It Runs
| Service | Image | Port | Purpose |
|---|---|---|---|
| PostgreSQL | postgres:16.10-alpine | 5432 | Primary database |
Two additional services are configured but disabled (commented out):
| Service | Image | Status | Purpose |
|---|---|---|---|
| ClickHouse | clickhouse:25.8 | Staged | Time-series analytics |
| Redis | redis:8.2.2 | Staged | Caching layer |
Starting the Local Environment
# From the backend directory
make up # Starts Docker services + restores DB from backup
make down # Stops services
make down-volumes # Stops services and removes data volumes
The make up command does more than just start Docker โ it also restores a database backup to give you a working dataset for development.
Production Container Build
The production Docker image is built using a multi-stage Dockerfile at backend/infrastructure/build/nmt.dockerfile.
Build Stages
- Builder stage โ compiles the Rust application (this takes the longest)
- Runtime stage โ copies the compiled binary into a minimal base image
Building Locally
make docker-build # Builds the Docker image
make docker-run # Runs the Docker container locally
Image Tagging
Production images are tagged with the Git SHA for traceability. Every image can be traced back to the exact commit that produced it.