Files
e-tib.com/docker-compose.dev.yml
Marc Mintel d14122005d Initial commit: E-TIB production hardening & E2E foundation
Former-commit-id: ef04fca3d76375630c05aac117bf586953f3b657
2026-04-28 19:11:38 +02:00

118 lines
3.4 KiB
YAML

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"
POSTGRES_URI: postgres://${PAYLOAD_DB_USER:-payload}:${PAYLOAD_DB_PASSWORD:-120in09oenaoinsd9iaidon}@etib-db:5432/${PAYLOAD_DB_NAME:-payload}
PAYLOAD_SECRET: ${PAYLOAD_SECRET:-fallback-secret-for-dev}
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'
curl -sf http://localhost:3001/api/health/cms > /dev/null 2>&1 && echo '[warmup] /api/health/cms 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"
etib-db:
image: postgres:15-alpine
restart: unless-stopped
env_file:
- ${ENV_FILE:-.env}
environment:
POSTGRES_DB: ${PAYLOAD_DB_NAME:-payload}
POSTGRES_USER: ${PAYLOAD_DB_USER:-payload}
POSTGRES_PASSWORD: ${PAYLOAD_DB_PASSWORD:-120in09oenaoinsd9iaidon}
# Docker Desktop on Mac routes host connections via external IP, not 127.0.0.1.
# Without this, pg_hba.conf rejects the connection as "no encryption".
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- etib_db_data:/var/lib/postgresql/data
networks:
- default
ports:
- "54322:5432"
etib-redis:
image: redis:7-alpine
restart: unless-stopped
networks:
- default
ports:
- "16379:6379"
networks:
default:
name: ${PROJECT_NAME:-e-tib}-internal
infra:
external: true
volumes:
etib_db_data:
external: false
etib_node_modules:
etib_next_cache:
etib_turbo_cache:
etib_pnpm_store: