Docker Deployment¶
Deploy Tempo using Docker Compose for easy production deployment.
Overview¶
Docker Compose provides the simplest way to deploy Tempo in production. The docker-compose.prod.yml file is configured for production use with pre-built images.
Prerequisites¶
- Docker and Docker Compose installed
- Sufficient disk space for database and media
- Network access (if using pre-built images from GitHub Container Registry)
Production Docker Compose¶
The production configuration (docker-compose.prod.yml) includes:
- Pre-built, version-pinned images from GitHub Container Registry
- Required secrets from
.env(JWT and database password) - Command center published only on
127.0.0.1:3004(Postgres and API stay on the Compose network) - Health checks and automatic restarts
Deployment Steps¶
1. Download Configuration¶
Ensure you have docker-compose.prod.yml and .env.example in your deployment directory.
2. Configure Environment Variables¶
Copy the example and fill in the required values. Compose refuses to start if either is missing or empty (do not leave them blank after cp).
Required (in .env):
JWT_SECRET_KEY— generate withopenssl rand -base64 32POSTGRES_PASSWORD— same value for Postgres and the API connection string. Do not use;(it splits the Npgsql connection string). Prefer a long random value for new installs (openssl rand -base64 32).
Existing Postgres volumes: POSTGRES_PASSWORD is applied only on first database init. If you already have a postgres_data volume, set POSTGRES_PASSWORD to the password already in that cluster (older installs often used postgres). Editing .env alone does not rotate the role password.
Rotating the database password: run ALTER USER postgres WITH PASSWORD '…'; inside Postgres, then update POSTGRES_PASSWORD in .env and recreate the API container so it picks up the new connection string.
Optional:
CARTO_BASEMAPS_API_KEY— free CARTO basemaps API key (removes map watermark)
3. Start Services¶
4. Verify Deployment¶
Check that all services are running:
Check logs:
5. Access Application¶
Put a reverse proxy (Caddy, nginx, Traefik) in front of one upstream: 127.0.0.1:3004. Use that public HTTPS origin for both the command center and the daily driver.
- Command center:
https://your.domain - Daily driver: the same origin (the app talks to
/api/...; Next.js rewrites/apito the API on the Compose network) - Ready (verify a deploy):
https://your.domain/api/ready(ordocker compose -f docker-compose.prod.yml exec api curl -f http://localhost:5001/ready). API liveness is/api/healthand can be200while Postgres is down. Publichttps://your.domain/healthis the command center process pulse, not the API — do not use it as the API check.
Upgrading from a split proxy (/ → :3004, /api → :5001): merge to a single upstream on 127.0.0.1:3004, or uncomment the loopback API publish in docker-compose.prod.yml (127.0.0.1:5001:5001) until you migrate.
Postgres and the API are not published on the host by default.
Image Versions¶
Production images are on GitHub Container Registry. The current tags are whatever docker-compose.prod.yml pins — update those pins when deploying a new release (do not treat latest as the production contract).
# After editing the tags in docker-compose.prod.yml:
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d
Network Configuration¶
Services share the default Compose project network and talk by service name:
postgres— databaseapi— APIfrontend— command center (Next.js; rewrites/apitoapi:5001)
Data Persistence¶
Database¶
Database data is stored in the postgres_data Docker volume. This persists across container restarts.
Media Files¶
Media files are stored in the ./media directory, mounted as a volume. Ensure this directory:
- Exists and is writable
- Has sufficient disk space
- Is included in backups
Updating¶
An upgrade is not a no-op reboot. Migrations run on API start, and some releases then rewrite older workouts in the background (startup backfills). Follow these steps:
- Back up. Back up the database with
pg_dumpand copy./media, or download a Settings → Export ZIP. See Backup and Restore. - Pin matching tags. Set the api and frontend images in
docker-compose.prod.ymlto the same release tag (e.g.v2.11.0). Don't uselatest, and don't mix versions. - Don't restart during an import. Check that no Strava ZIP import or Tempo restore is in progress. When the API starts, it marks any unfinished import job
failed(interrupted) and deletes its uploaded archive. The job does not resume; start it again after the upgrade. - Pull and start.
- Check the backfill line. Starts don't run backfills. The API logs
Startup backfills: all 8 complete; none runwhen there's nothing to do: If it warns that somehave not completed on this library(an install that skipped versions, or a release that adds a backfill), run the catch-up command once and wait forBackfills finished: all 8 recorded complete: On a large library this can take a while and means extra CPU, disk, and Postgres WAL. Browsing works throughout. Tempo 2.11.0 and earlier ran every backfill on every start instead. - Smoke test.
curl -f https://tempo.example.com/api/readyreturns 200 once the API can reach the database. It does not wait for backfills.
To run backfills at startup instead (hosts without exec), or to force a full re-run, see Startup backfills.
Leaving the experimental :feat-ai-coach image¶
The experimental coach feature image (ghcr.io/.../api:feat-ai-coach / frontend:feat-ai-coach) is retiring; new publishes of that tag have stopped. Move back to a supported tag (edge, a release v*, or whatever docker-compose.prod.yml pins).
On the next API start, Tempo drops any leftover Coach* tables and removes matching __EFMigrationsHistory rows. That discards in-Tempo coach data (goals, weeks, check-ins, etc.). Workouts, settings, shoes, and other core Tempo data stay intact. There is no opt-out.
Stopping Services¶
To remove volumes (clears database):
Password recovery¶
Forgot the only Tempo passphrase: do not delete volumes and do not hand-edit BCrypt in Postgres. From the directory with your Compose file:
Scripts (no TTY):
docker compose -f docker-compose.prod.yml exec -T api dotnet Tempo.Api.dll reset-password --password-stdin
If the API container is not running:
The image ENTRYPOINT is already dotnet Tempo.Api.dll, so reset-password is passed as the verb. On a bare API host: dotnet Tempo.Api.dll reset-password from the API working directory. After a successful reset, log in again (old sessions are invalid). Full notes: How do I reset my password?.
Troubleshooting¶
Services Not Starting¶
- Check logs:
docker compose -f docker-compose.prod.yml logs - Verify
.envhas non-emptyJWT_SECRET_KEYandPOSTGRES_PASSWORD(copy from.env.example) - Ensure port
3004is not in use on loopback - Check disk space
Database Connection Issues¶
- Verify PostgreSQL container is healthy
- Confirm
POSTGRES_PASSWORDin.envmatches the password in an existing volume (init only runs once) - Ensure network connectivity between services
Image Pull Failures¶
- Verify network connectivity
- Check image tags are correct
- Ensure authentication if using private registry