name: convene services: postgres: image: postgres:16-alpine container_name: convene-postgres environment: POSTGRES_DB: ${POSTGRES_DB:-convene} POSTGRES_USER: ${POSTGRES_USER:-convene} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-convene} ports: - '${POSTGRES_PORT:-5432}:5432' volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-convene} -d ${POSTGRES_DB:-convene}'] interval: 10s timeout: 5s retries: 5 start_period: 15s restart: unless-stopped redis: image: redis:7-alpine container_name: convene-redis command: ['redis-server', '--appendonly', 'yes'] ports: - '${REDIS_PORT:-6379}:6379' volumes: - redis_data:/data healthcheck: test: ['CMD', 'redis-cli', 'ping'] interval: 10s timeout: 5s retries: 5 restart: unless-stopped api: build: context: . dockerfile: apps/api/Dockerfile container_name: convene-api depends_on: postgres: condition: service_healthy redis: condition: service_healthy env_file: .env environment: NODE_ENV: production PORT: 3001 DATABASE_URL: postgresql://${POSTGRES_USER:-convene}:${POSTGRES_PASSWORD:-convene}@postgres:5432/${POSTGRES_DB:-convene} REDIS_URL: redis://redis:6379 ports: - '3001:3001' healthcheck: test: ['CMD', 'node', '-e', "fetch('http://127.0.0.1:3001/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"] interval: 20s timeout: 5s retries: 5 start_period: 20s restart: unless-stopped web: build: context: . dockerfile: apps/web/Dockerfile args: # Next inlines NEXT_PUBLIC_* at build time, so they must be build args. NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:3001} NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000} container_name: convene-web depends_on: api: condition: service_started env_file: .env environment: NODE_ENV: production PORT: 3000 HOSTNAME: '0.0.0.0' ports: - '3000:3000' restart: unless-stopped volumes: postgres_data: redis_data: