Skip to main content
Tracera ships with two Docker Compose configurations: one for development with hot reload, and one for production with hardened security.

Services

Both configurations run these services:
ServiceImagePurpose
appCustom Go buildTracera backend API server
webCustom Next.js buildTracera frontend
timescaledbtimescale/timescaledb:2.25.1-pg16Time-series database
redisredis:7.4-alpineCache, pub/sub, sessions

Development Stack

make docker-dev
The development stack provides:
  • Hot reload for Go via air — edit Go files and the server restarts automatically
  • Turbopack for Next.js — instant frontend hot module replacement
  • Mounted volumes — source code is mounted into containers for live editing
  • Debug-friendly — full logs, no resource constraints

Architecture

┌─────────────┐     ┌─────────────┐
│   web:3000  │────▶│  app:8080   │
│  (Next.js)  │     │   (Go/Gin)  │
└─────────────┘     └──────┬──────┘

              ┌────────────┼────────────┐
              ▼                         ▼
    ┌─────────────────┐     ┌─────────────────┐
    │ timescaledb:5432│     │   redis:6379     │
    └─────────────────┘     └─────────────────┘

Production Stack

make docker-prod
The production stack adds:
  • Multi-stage builds — Go binary compiled with -trimpath and stripped symbols in a distroless base image
  • Read-only filesystems — containers run with read-only root filesystems where possible
  • No new privilegessecurity_opt: no-new-privileges:true on all services
  • Dropped capabilitiescap_drop: ALL to minimize attack surface
  • Resource limits — CPU and memory constraints on all services
  • Health checks — built-in health checks for all services with restart policies
  • Named volumes — persistent data volumes for TimescaleDB and Redis

Health Checks

All services include Docker health checks:
ServiceCheckInterval
appCustom binary at /healthcheck10s
timescaledbpg_isready10s
redisredis-cli ping10s

Networking

All services run on the tracera Docker network. Service names are used as hostnames:
  • Backend connects to timescaledb:5432 and redis:6379
  • Frontend connects to app:8080 (server-side) and localhost:8080 (client-side)

Volumes

VolumePurpose
timescaledb_dataPersistent database storage
redis_dataPersistent Redis data (AOF/RDB)