# retro-webhook - Auto-deploy listener for retro.vish.gg
#
# Receives Gitea push webhooks and updates the retro-site container
# in-place via `docker exec` — no container restart required.
#
# Deploy pipeline:
#   git push Vish/retro_site
#     → Gitea webhook #19 → POST http://100.103.48.78:8027/hooks/retro-site-deploy
#       → deploy.sh: docker exec retro-site (git clone + cp dist/ + nginx reload)
#         → site live in ~9s
#
# Config files must exist on the host before starting:
#   /volume1/docker/retro-webhook/hooks.json   (see hooks.json in this directory)
#   /volume1/docker/retro-webhook/deploy.sh    (see deploy.sh in this directory)
#
# Setup:
#   mkdir -p /volume1/docker/retro-webhook
#   cp hooks.json deploy.sh /volume1/docker/retro-webhook/
#   chmod +x /volume1/docker/retro-webhook/deploy.sh
#   docker compose -f docker-compose.yaml up -d

services:
  retro-webhook:
    image: almir/webhook
    container_name: retro-webhook
    restart: unless-stopped
    user: root
    ports:
      - '8027:9000'
    volumes:
      - /volume1/docker/retro-webhook:/config:ro
      - /var/run/docker.sock:/var/run/docker.sock
      # Synology docker binary is not in PATH; bind-mount it directly
      - /var/packages/REDACTED_APP_PASSWORD/target/usr/bin/docker:/usr/local/bin/docker:ro
    command: ["-verbose", "-hooks=/config/hooks.json", "-hotreload"]
