services: backend: build: context: ./backend dockerfile: Dockerfile container_name: quantlab-backend ports: - "8000:8000" # Exposed for direct access / debugging volumes: - ./paper_trading.log:/app/paper_trading.log # Persist log on host environment: - PYTHONUNBUFFERED=1 restart: unless-stopped healthcheck: # python:3.11-slim has no curl — use stdlib urllib instead test: [ "CMD", "python", "-c", "import urllib.request, sys; urllib.request.urlopen('http://localhost:8000/docs'); sys.exit(0)" ] interval: 20s timeout: 10s retries: 5 start_period: 30s frontend: build: context: ./frontend dockerfile: Dockerfile container_name: quantlab-frontend ports: - "3000:80" # Visit http://localhost:3000 depends_on: - backend # start after backend; nginx will retry API calls naturally restart: unless-stopped