Docker Setup

Docker Compose orchestrates all local development services for Renewa One.

Compose Files

FilePurpose
renewa-one/docker-compose.ymlBase config: PostgreSQL 18-alpine, Redis 8-alpine
renewa-one/docker-compose.local.ymlDev override: backend with hot-reload (Dockerfile.dev), env vars
renewa-one/docker-compose.test.ymlTest runner configuration

Production Build

renewa-one/Dockerfile (14.9KB) uses a multi-stage build with Bun:

  1. deps — install dependencies
  2. build — compile frontend + backend
  3. runtime — minimal production image

nginx Configuration

ConfigPurpose
renewa-one/nginx.confSPA routing, /api/* proxy to backend:3000, /health endpoint, 100MB upload limit
renewa-one/nginx.dev.confDevelopment-specific overrides

nginx serves static frontend files and proxies API requests to the backend on port 3000. Fly.io connects to port 80 (nginx).

Named Volumes

VolumeContent
postgres_dataDatabase Architecture persistent storage
redis_dataRedis cache and Background Jobs queue data

Port Allocation

ServiceDefault Port
nginx80
Backend3000
Frontend (Vite)5173
PostgreSQL5432

Each worktree gets an isolated Docker stack via make setup, which calls ./scripts/allocate-dev-ports.sh. Ports are deterministic in the range 10000-19999, with a unique COMPOSE_PROJECT_NAME per worktree. See Scripts for details.

Background Workers

renewa-one/supervisord.conf manages Background Jobs workers alongside the main application process in the production container.

Environment Precedence

.env.local > .env > docker-compose.local.yml

Run [[Makefile Commands|make setup]] to generate env files. Set JWT_SECRET in .env on first run:

openssl rand -base64 32

Key Files

  • renewa-one/docker-compose.yml
  • renewa-one/docker-compose.local.yml
  • renewa-one/docker-compose.test.yml
  • renewa-one/Dockerfile
  • renewa-one/Dockerfile.dev
  • renewa-one/nginx.conf
  • renewa-one/nginx.dev.conf
  • renewa-one/supervisord.conf

See Also