# docker-compose.yml — Development (hot-reload) # # Usage: # docker compose up # # Frontend: http://localhost:3000 # Backend: http://localhost:4000 # Jaeger UI: http://localhost:16686 # # For production: # docker compose -f docker-compose.prod.yml up services: backend: build: context: . dockerfile: backend/Dockerfile.dev ports: - "4000:4000" environment: - PORT=4000 - NODE_ENV=development - STELLAR_NETWORK=testnet - HORIZON_URL=https://horizon-testnet.stellar.org - ALLOWED_ORIGINS=http://localhost:3000 - JWT_SECRET=dev-secret-change-in-production - TURRETS_EVALUATION_INTERVAL_MS=30000 # Enable distributed tracing to local Jaeger - OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4318 - REDIS_URL=redis://redis:6379 - DB_PROVIDER=${DB_PROVIDER:-sqlite} # Optional: set to enable AI payment parsing via Anthropic # - ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxx depends_on: redis: condition: service_started volumes: # Mount source for hot-reload via nodemon - ./backend:/app # Mount shared module for require("../../shared/...") paths - ./shared:/shared # Preserve container's node_modules - /app/node_modules healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"] interval: 15s timeout: 5s retries: 3 start_period: 10s restart: unless-stopped frontend: build: context: ./frontend dockerfile: Dockerfile.dev ports: - "3000:3000" environment: - NEXT_PUBLIC_STELLAR_NETWORK=testnet - NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org - NEXT_PUBLIC_API_URL=http://localhost:4000 # Enable polling so file-watch works on all host OSes (Linux/macOS/Windows) - WATCHPACK_POLLING=true - CHOKIDAR_USEPOLLING=true volumes: # Mount source for hot-reload via Next.js HMR - ./frontend:/app # Preserve container's node_modules and Next.js build cache - /app/node_modules - /app/.next depends_on: backend: condition: service_healthy healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:3000"] interval: 15s timeout: 5s retries: 5 start_period: 30s restart: unless-stopped # ─── Redis (shared rate-limit store) ────────────────────────────────────────── redis: image: redis:7-alpine ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 restart: unless-stopped # ─── Jaeger all-in-one (local distributed tracing) ─────────────────────────── jaeger: image: jaegertracing/all-in-one:1.64 ports: - "16686:16686" # Jaeger UI - "4318:4318" # OTLP HTTP/protobuf receiver environment: - COLLECTOR_OTLP_ENABLED=true healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:16686"] interval: 15s timeout: 5s retries: 3 start_period: 10s restart: unless-stopped