# Free-tier friendly: ONE container (web + API), ~1GB RAM VMs (Vultr / Oracle Cloud)
# Usage: cp .env.example .env && docker compose -f docker-compose.single.yml up -d --build

services:
  zendo:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: zendo
    restart: unless-stopped
    ports:
      - "${PUBLIC_PORT:-8080}:8080"
    env_file:
      - .env
    environment:
      HOST: 0.0.0.0
      PORT: 8080
      RUNTIME: bun
      SERVE_WEB: "true"
      DB_FILE_PATH: /data/zendo-store.json
      NODE_OPTIONS: "--max-old-space-size=1536"
    volumes:
      - zendo_data:/data
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/api/health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 180s
    deploy:
      resources:
        limits:
          memory: 1800M

volumes:
  zendo_data:
