Files
bot-dashboard/docker-compose.yml
Claude 22fce19050 fix: Resolve Docker build failures for frontend and backend
Backend fixes:
- Add g++ and build-essential for complete C++ compilation support
- Upgrade pip, setuptools, and wheel before installing dependencies
- Ensures psutil and other packages with native extensions build correctly

Frontend fixes:
- Add build arguments for NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL
- Pass environment variables during Docker build stage
- Set default values to prevent undefined destination in Next.js rewrites
- Configure docker-compose to pass build arguments to frontend service

These changes resolve:
- psutil build failure: "ERROR: Failed building wheel for psutil"
- Next.js build error: "Invalid rewrite found" with undefined destination
2025-11-21 11:58:56 +00:00

54 lines
1.3 KiB
YAML

version: '3.8'
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: bot-dashboard-backend
ports:
- "8000:8000"
volumes:
- ./bots:/app/bots
- ./backend/app:/app/app
- bot-data:/app/data
environment:
- DATABASE_URL=sqlite:///./data/bot_dashboard.db
- SECRET_KEY=${SECRET_KEY:-dev-secret-key-change-in-production}
- CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
- LOG_LEVEL=INFO
- AUTO_RESTART_BOTS=true
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_API_URL=http://localhost:8000
- NEXT_PUBLIC_WS_URL=ws://localhost:8000
container_name: bot-dashboard-frontend
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:8000
- NEXT_PUBLIC_WS_URL=ws://localhost:8000
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
volumes:
bot-data:
driver: local
networks:
default:
name: bot-dashboard-network