services:
  backend:
    image: git.shts.su/denozord/mikrotikmanager-backend:latest
    container_name: mmapp-backend
    restart: unless-stopped
    ports:
      - "8000:8000"
    environment:
      CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
    volumes:
      - /opt/mmapp/data:/app/data
    labels:
      mmapp.updater.managed: "true"
      mmapp.updater.target: backend
      mmapp.updater.image: git.shts.su/denozord/mikrotikmanager-backend:latest

  frontend:
    image: git.shts.su/denozord/mikrotikmanager-frontend:latest
    container_name: mmapp-frontend
    restart: unless-stopped
    ports:
      - "3000:3000"
    labels:
      mmapp.updater.managed: "true"
      mmapp.updater.target: frontend
      mmapp.updater.image: git.shts.su/denozord/mikrotikmanager-frontend:latest

  updater:
    image: git.shts.su/denozord/mikrotikmanager-updater:latest
    container_name: mmapp-updater
    restart: unless-stopped
    environment:
      REGISTRY: git.shts.su
      REGISTRY_USERNAME: ${REGISTRY_USERNAME:-}
      REGISTRY_PASSWORD: ${REGISTRY_PASSWORD:-}
      POLL_INTERVAL_SECONDS: ${POLL_INTERVAL_SECONDS:-300}
      HEALTH_TIMEOUT_SECONDS: ${HEALTH_TIMEOUT_SECONDS:-120}
      STOP_TIMEOUT_SECONDS: ${STOP_TIMEOUT_SECONDS:-30}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/mmapp/state:/state
      - /opt/mmapp/updater/targets.json:/etc/updater/targets.json:ro
