version: '3.8' services: # Frontend dev server (Vite HMR) frontend: build: context: . dockerfile: Dockerfile target: builder ports: - "3000:3000" volumes: - ./src:/app/src - ./index.html:/app/index.html - /app/node_modules command: npm run dev -- --host 0.0.0.0 environment: - VITE_API_URL=http://backend:3001 depends_on: backend: condition: service_healthy # Backend API + WebSocket server backend: build: context: . dockerfile: Dockerfile target: builder ports: - "3001:3001" volumes: - ./server:/app/server - /app/node_modules command: npx tsx --watch server/index.ts environment: - NODE_ENV=development - CORS_ORIGIN=http://localhost:3000 - LOG_LEVEL=debug healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/api/health"] interval: 10s timeout: 5s retries: 5 start_period: 10s networks: default: name: homelab-topology