services: postgresdb: image: postgres:15-alpine container_name: formcraft-postgres restart: unless-stopped environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: dev ports: - "5432:5432" volumes: - pg_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d dev"] interval: 10s timeout: 5s retries: 5 networks: - formcraft-network api: build: context: . dockerfile: apps/api/Dockerfile container_name: formcraft-api restart: unless-stopped ports: - "8000:8000" environment: NODE_ENV: production PORT: 8000 BASE_URL: http://localhost:8000 FRONTEND_URL: http://localhost:3000 CORS_ORIGINS: http://localhost:3000 DATABASE_URL: postgresql://postgres:postgres@postgresdb:5432/dev JWT_SECRET: ${JWT_SECRET:-super-secure-production-jwt-secret-minimum-32-chars-long} RATE_LIMIT_WINDOW_MS: 60000 RATE_LIMIT_MAX_REQUESTS: 100 depends_on: postgresdb: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 20s timeout: 5s retries: 3 start_period: 15s networks: - formcraft-network web: build: context: . dockerfile: apps/web/Dockerfile args: NEXT_PUBLIC_API_URL: http://localhost:8000/trpc NEXT_PUBLIC_API_DOCS_URL: http://localhost:8000/docs container_name: formcraft-web restart: unless-stopped ports: - "3000:3000" environment: NODE_ENV: production PORT: 3000 NEXT_PUBLIC_API_URL: http://localhost:8000/trpc NEXT_PUBLIC_API_DOCS_URL: http://localhost:8000/docs depends_on: api: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000"] interval: 20s timeout: 5s retries: 3 start_period: 20s networks: - formcraft-network volumes: pg_data: driver: local networks: formcraft-network: driver: bridge