services: api: build: context: . target: api environment: LMS_DATA_DIR: /data LMS_TOKEN_SECRET: ${LMS_TOKEN_SECRET:-} volumes: - lms_data:/data ports: - "${API_PORT:-8000}:8000" restart: unless-stopped healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=5)"] interval: 30s timeout: 5s retries: 3 start_period: 10s frontend: build: context: . target: frontend environment: LMS_API_URL: ${LMS_API_URL:-http://api:8000} ports: - "${FRONTEND_PORT:-8080}:8080" restart: unless-stopped depends_on: api: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/healthz', timeout=5)"] interval: 30s timeout: 5s retries: 3 start_period: 10s volumes: lms_data: