Server Setup
The backend ships as a three-container Docker Compose stack: the middleman, InfluxDB, and Grafana, all on one bridge network.
Stack
| Service | Image / build | Purpose |
|---|---|---|
middleman | built from the repo Dockerfile (python:3.11-slim) | The middleman process, see Middleman |
influxdb | ${INFLUXDB_IMAGE} | Telemetry, stats, and analysis buckets, see InfluxDB |
grafana | ${GRAFANA_IMAGE} | Live dashboards, see Grafana |
Ports
| Port | Maps to | What |
|---|---|---|
${UDP_PORT}/udp | container ${UDP_PORT} | Telemetry UDP ingest from the car |
8005 | container 8000 | Web dashboard and REST API |
${INFLUXDB_HTTP_PORT} | container 8086 | InfluxDB UI/API |
${GRAFANA_HTTP_PORT} | container 3000 | Grafana UI |
Quick start
cp .env.example .env
# Fill in INFLUX_TOKEN, INFLUX_ORG, GRAFANA_API_KEY, MARPLE_API_TOKEN
docker compose up --build -dEvery setting the Python process reads (config.py) and every setting the Compose file reads come from the same .env, so there's one file to configure per deployment.
.env.example is out of date
The checked-in .env.example uses older variable names (GRAFANA_TOKEN, QUEUE_MAX, MEASUREMENT, UDP_IP) that don't match what config.py actually reads (GRAFANA_API_KEY, INFLUX_QUEUE_SIZE/MARPLE_QUEUE_SIZE/ANALYSIS_QUEUE_SIZE, INFLUX_MEASUREMENT, UDP_HOST). Treat config.py as the source of truth for the middleman's own variable names; the InfluxDB and Grafana container variables (DOCKER_INFLUXDB_INIT_*, GF_*) in .env.example are accurate as-is.
Deployment (CI/CD)
.github/workflows/deploy.yml runs on every push to main: it SSHs into the production host and runs redeploy.sh in /srv/docker/compose, which pulls the latest image and restarts the stack.
Manual update
From the server, update/update.sh rebuilds and restarts without touching InfluxDB/Grafana data:
./update/update.sh # rebuild middleman only
./update/update.sh --all # also recreate influxdb + grafana containersupdate/docker-compose.yml looks stale
That file builds the middleman image from a different git repository and branch (SoftwareStack2026, feature/telemetry/backendV2, subfolder telemetry) rather than the local build context the root docker-compose.yml uses. It appears to predate this repo's split from a monorepo. update.sh runs against whichever docker-compose.yml sits in its working directory, so confirm which one is actually deployed on the server before relying on this file.
Logging
The middleman container logs with the json-file driver, capped at 10 MB times 3 files, so docker logs won't grow unbounded on a machine that's rarely rebooted.
