services: # PostgreSQL Database db: image: postgres:16-alpine environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: sessions volumes: - postgres_data:/var/lib/postgresql/data ports: - "55432:5432" # avoid clashing with host postgres healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 # FastAPI Backend backend: build: ./backend ports: - "${BACKEND_PORT:-8000}:8000" env_file: - .env environment: - DATABASE_URL=postgresql://postgres:postgres@db:5432/sessions - BACKEND_URL=http://host.docker.internal:8000 # Internal URL for agent containers - SERVICE_TOKEN=local-dev-token # Ensure token is set for agent auth - VNC_HOST=localhost # Host for VNC access from frontend depends_on: db: condition: service_healthy volumes: - ./backend/app:/app/app # Hot reload for development - /var/run/docker.sock:/var/run/docker.sock # Docker socket for container management command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload # React Frontend frontend: build: context: ./frontend args: # For local dev with nginx proxy, use empty string so relative URLs work VITE_API_URL: "" VITE_WS_URL: "" # Use nginx.dev.conf which proxies /api to backend NGINX_CONF: nginx.dev.conf ports: - "3000:80" env_file: - .env depends_on: - backend volumes: postgres_data: