Docker Setup
Docker Compose orchestrates all local development services for Renewa One.
Compose Files
| File | Purpose |
|---|---|
renewa-one/docker-compose.yml | Base config: PostgreSQL 18-alpine, Redis 8-alpine |
renewa-one/docker-compose.local.yml | Dev override: backend with hot-reload (Dockerfile.dev), env vars |
renewa-one/docker-compose.test.yml | Test runner configuration |
Production Build
renewa-one/Dockerfile (14.9KB) uses a multi-stage build with Bun:
- deps — install dependencies
- build — compile frontend + backend
- runtime — minimal production image
nginx Configuration
| Config | Purpose |
|---|---|
renewa-one/nginx.conf | SPA routing, /api/* proxy to backend:3000, /health endpoint, 100MB upload limit |
renewa-one/nginx.dev.conf | Development-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
| Volume | Content |
|---|---|
postgres_data | Database Architecture persistent storage |
redis_data | Redis cache and Background Jobs queue data |
Port Allocation
| Service | Default Port |
|---|---|
| nginx | 80 |
| Backend | 3000 |
| Frontend (Vite) | 5173 |
| PostgreSQL | 5432 |
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 32Key Files
renewa-one/docker-compose.ymlrenewa-one/docker-compose.local.ymlrenewa-one/docker-compose.test.ymlrenewa-one/Dockerfilerenewa-one/Dockerfile.devrenewa-one/nginx.confrenewa-one/nginx.dev.confrenewa-one/supervisord.conf
See Also
- Makefile Commands — primary interface to Docker operations
- Architecture Overview — system topology
- Background Jobs — worker process management
- Database Architecture — PostgreSQL configuration