version: '3.8' services: backend: build: context: ./backend dockerfile: Dockerfile container_name: web-research-backend ports: - "3001:3001" environment: - PORT=3001 - NODE_ENV=production - BROWSERBASE_API_KEY=${BROWSERBASE_API_KEY} - BROWSERBASE_PROJECT_ID=${BROWSERBASE_PROJECT_ID} - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} - ANTHROPIC_MODEL=${ANTHROPIC_MODEL:-claude-3-5-sonnet-20241022} - ALLOWED_ORIGINS=http://localhost:3000 restart: unless-stopped networks: - web-research-network healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s frontend: build: context: ./frontend dockerfile: Dockerfile args: - NEXT_PUBLIC_API_URL=http://localhost:3001 - NEXT_PUBLIC_WS_URL=ws://localhost:3001 container_name: web-research-frontend ports: - "3000:3000" environment: - NODE_ENV=production - NEXT_PUBLIC_API_URL=http://localhost:3001 - NEXT_PUBLIC_WS_URL=ws://localhost:3001 depends_on: backend: condition: service_healthy restart: unless-stopped networks: - web-research-network networks: web-research-network: driver: bridge # Usage: # 1. Create a .env file in the root directory with your API keys # 2. Run: docker-compose up -d # 3. Access frontend at http://localhost:3000 # 4. Access backend at http://localhost:3001