services: # Lightweight proxy: gives Caddy the labels to route etib.localhost → host Mac etib-proxy: image: alpine:latest command: sleep infinity restart: unless-stopped networks: - infra - default labels: - "caddy=http://${TRAEFIK_HOST:-etib.localhost}" - "caddy.reverse_proxy=http://etib-app:3001" extra_hosts: - "host.docker.internal:host-gateway" # Full Docker dev (use with `pnpm run dev:docker`) etib-app: build: context: . dockerfile: Dockerfile.dev working_dir: /app restart: unless-stopped networks: default: infra: aliases: - etib-app - etib.localhost env_file: - ${ENV_FILE:-.env} environment: NODE_ENV: development # Force Garbage Collection before Docker kills the container (OOM) NODE_OPTIONS: "--max-old-space-size=6144" NEXT_TELEMETRY_DISABLED: "1" UV_THREADPOOL_SIZE: "1" RAYON_NUM_THREADS: "1" NEXT_PRIVATE_WORKER_THREADS: "false" NPM_TOKEN: ${NPM_TOKEN:-} CI: "true" WATCHPACK_POLLING: "true" volumes: - .:/app - etib_node_modules:/app/node_modules - etib_next_cache:/app/.next - etib_turbo_cache:/app/.turbo - etib_pnpm_store:/pnpm - /app/.git - /app/reference - /app/data deploy: resources: limits: memory: 8G command: > sh -c "pnpm install --no-frozen-lockfile && while true; do ( echo '[warmup] Waiting for Next.js to be reachable...' until curl -sf http://localhost:3001 > /dev/null; do sleep 2; done echo '[warmup] Server is up! Pre-compiling routes...' curl -sf http://localhost:3001/de > /dev/null 2>&1 && echo '[warmup] /de ready' echo '[warmup] All routes pre-compiled ✓' ) & pnpm next dev --webpack --hostname 0.0.0.0 --port 3001; echo '[etib-app] next dev exited, restarting in 2s...'; sleep 2; done" labels: - "traefik.enable=true" - "traefik.http.services.${PROJECT_NAME:-klz}-app-svc.loadbalancer.server.port=3001" - "traefik.docker.network=infra" networks: default: name: ${PROJECT_NAME:-e-tib}-internal infra: external: true volumes: etib_node_modules: etib_next_cache: etib_turbo_cache: etib_pnpm_store: