Starter Docs

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

FragmentContents
docker/compose/postgres.ymlPostgres 16, named volume, healthcheck
docker/compose/nest-api.ymlNestJS API (multi-stage Bun image)
docker/compose/web.ymlNext.js web (standalone image)
docker/compose/rust-api.ymlOptional Rust demo API (--profile rust)

See docker/README.md for the manual -f fallback.

Setup

  1. Copy env file (from repo root):

    cp env.docker.example .env

    Set JWT_SECRET and AUTH_TOKEN_SECRET (32+ characters). Adjust ports if needed.

  2. Build and start the stack:

    docker compose up -d --build
  3. Open:

Ports

ServiceHost port (default)
Postgres5433 (container 5432)
Nest API4000
Web3000
Rust API (profile)3002

Notes

  • Nest runs migrations on startup when RUN_MIGRATIONS=true (default).
  • NEXT_PUBLIC_NEST_API_URL is baked in at web image build time and must be reachable from the browser (typically http://localhost:4000).
  • Host-only API/web development: docker compose up -d postgres, then bun run dev.
  • Optional Rust service: docker compose --profile rust up -d --build.

On this page