services:
  mood-archive:
    build: .
    container_name: mood-archive
    restart: unless-stopped
    environment:
      TZ: Europe/Moscow
      MOOD_DB_PATH: /data/mood_archive.sqlite
      MOOD_SOURCE_DB_PATH: /source/moodtracker/mood.db
      # Manual-entry data; hourly polling is more than enough (local file read).
      MOOD_SYNC_INTERVAL_SECONDS: ${MOOD_SYNC_INTERVAL_SECONDS:-3600}
      MOOD_OVERLAP_ROWS: ${MOOD_OVERLAP_ROWS:-3}
    volumes:
      # Local mood archive lives alongside the other Agap databases.
      - /mnt/dbs/mood:/data
      # moodtracker's own SQLite file, READ-ONLY — no credentials, no HTTP,
      # no risk of this service ever writing into the live app's DB.
      - /home/alvis/moodtracker/data:/source/moodtracker:ro
    logging:
      options:
        max-size: 10m
