File size: 814 Bytes
a8358d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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: