# CentOS 6 production overlay — headless mode, no start_interval
#
# Replaces docker-compose.prod.yml on CentOS 6 hosts. Identical to the prod
# overlay except:
#   - No start_interval in healthchecks (requires Docker 25+ / Compose 2.28+)
#   - Viewer runs headless only (no devices, no privileged, no pid:host)
#
# CentOS 6 requires ELRepo kernel 4.4+ and Docker CE installed via static
# binaries (RPMs require systemd). See DEPLOYMENT.md for details.

services:
  backend:
    privileged: true
    pid: "host"
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
    volumes:
      - type: bind
        source: /videostore
        target: /videostore
        bind:
          propagation: slave
  engine:
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
    volumes:
      - type: bind
        source: /videostore
        target: /videostore
        bind:
          propagation: slave
  connector:
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
    volumes:
      - type: bind
        source: /videostore
        target: /videostore
        bind:
          propagation: slave
  playback:
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
    volumes:
      - type: bind
        source: /videostore
        target: /videostore
        bind:
          propagation: slave
  viewer:
    environment:
      - NVR_HEADLESS=${NVR_HEADLESS-}
    volumes:
      - type: bind
        source: /videostore
        target: /videostore
        bind:
          propagation: slave
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  watchtower:
    image: containrrr/watchtower:latest
    restart: always
    network_mode: host
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /root/.docker/config.json:/config.json:ro
    environment:
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_LABEL_ENABLE=true
      - WATCHTOWER_SCHEDULE=${WATCHTOWER_SCHEDULE:-0 0 2 * * *}
      - DOCKER_API_VERSION=${DOCKER_API_VERSION:-1.44}
    command: --label-enable
