services: api: build: context: . dockerfile: Dockerfile image: microclimate-x:latest container_name: microclimate-x restart: unless-stopped ports: - "8000:8000" environment: # Override Dockerfile default (/tmp, HF-Spaces-friendly) with the named # volume so cache.sqlite3 survives container restarts on self-hosting. - MICROCLIMATEX_DB=/data/cache.sqlite3 - MICROCLIMATEX_GIT_REV=${MICROCLIMATEX_GIT_REV:-docker} volumes: - mcx-data:/data healthcheck: test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0) if urllib.request.urlopen('http://localhost:8000/api/health',timeout=2).status==200 else sys.exit(1)"] interval: 30s timeout: 5s retries: 3 start_period: 10s volumes: mcx-data: