Docker
Compose stack for Postgres, Nest API, and Next.js web.
Run the Starter stack with Docker Compose. Fragments live under docker/compose/ and are merged by the root docker-compose.yml via include (Compose v2.20+). Compose files follow the Compose Spec (no top-level version key).
Layout
| Fragment | Contents |
|---|---|
docker/compose/postgres.yml | Postgres 16, named volume, healthcheck |
docker/compose/nest-api.yml | NestJS API (multi-stage Bun image) |
docker/compose/web.yml | Next.js web (standalone image) |
docker/compose/rust-api.yml | Optional Rust demo API (--profile rust) |
See docker/README.md for the manual -f fallback.
Setup
-
Copy env file (from repo root):
cp env.docker.example .envSet
JWT_SECRETandAUTH_TOKEN_SECRET(32+ characters). Adjust ports if needed. -
Build and start the stack:
docker compose up -d --build -
Open:
- Web: http://localhost:3000
- Nest health: http://localhost:4000/api/v1/health
- Nest Swagger: http://localhost:4000/api/docs
Ports
| Service | Host port (default) |
|---|---|
| Postgres | 5433 (container 5432) |
| Nest API | 4000 |
| Web | 3000 |
| Rust API (profile) | 3002 |
Notes
- Nest runs migrations on startup when
RUN_MIGRATIONS=true(default). NEXT_PUBLIC_NEST_API_URLis baked in at web image build time and must be reachable from the browser (typicallyhttp://localhost:4000).- Host-only API/web development:
docker compose up -d postgres, thenbun run dev. - Optional Rust service:
docker compose --profile rust up -d --build.