services: # Frontend Build Container (builds once and exits) frontend-build: image: node:20-alpine container_name: grademaxxing-frontend-build working_dir: /app command: sh -c "corepack enable && pnpm install --frozen-lockfile && pnpm run build" volumes: - ./:/app env_file: - ./.env environment: - CI=true networks: - grademaxxing-network # Python Backend (serves API and static files) backend: image: python:3.9 container_name: grademaxxing-backend restart: unless-stopped working_dir: /app command: sh -c "cd backend && pip install --no-cache-dir -r requirements.txt && uvicorn main:app --host 0.0.0.0 --port 8000" ports: - "4442:8000" volumes: - .:/app env_file: - ./.env networks: - grademaxxing-network healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"] interval: 30s timeout: 10s retries: 3 networks: grademaxxing-network: driver: bridge