# Stack de production NerdWare (postgres + serveur + client). # Pensé pour Dokploy (assigne les domaines via Traefik) ou un `docker compose up`. # # Variables attendues (UI Dokploy ou fichier .env à côté de ce fichier) : # POSTGRES_PASSWORD mot de passe Postgres # ADMIN_TOKEN jeton du back-office quiz # CORS_ORIGINS domaine(s) du client, ex. https://nerdware.example.com # VITE_SERVER_URL URL publique du serveur, ex. https://api.nerdware.example.com services: postgres: image: postgres:17-alpine restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-nerdware} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-nerdware} POSTGRES_DB: ${POSTGRES_DB:-nerdware} volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-nerdware} -d ${POSTGRES_DB:-nerdware}"] interval: 5s timeout: 5s retries: 5 server: build: context: . dockerfile: apps/server/Dockerfile restart: unless-stopped depends_on: postgres: condition: service_healthy environment: NODE_ENV: production HOST: 0.0.0.0 PORT: 3001 # Connexion via PG* (mot de passe passé tel quel, pas d'encodage d'URL). PGHOST: postgres PGPORT: 5432 PGUSER: ${POSTGRES_USER:-nerdware} PGPASSWORD: ${POSTGRES_PASSWORD:-nerdware} PGDATABASE: ${POSTGRES_DB:-nerdware} ADMIN_TOKEN: ${ADMIN_TOKEN} CORS_ORIGINS: ${CORS_ORIGINS} UPLOADS_DIR: /data/uploads volumes: - uploads:/data/uploads expose: - "3001" web: build: context: . dockerfile: apps/web/Dockerfile args: VITE_SERVER_URL: ${VITE_SERVER_URL} VITE_UMAMI_SRC: ${VITE_UMAMI_SRC:-} VITE_UMAMI_WEBSITE_ID: ${VITE_UMAMI_WEBSITE_ID:-} restart: unless-stopped depends_on: - server expose: - "80" volumes: pgdata: uploads: