version: '3.8'

services:
  monitor-client:
    image: docker.1panel.live/library/alpine:latest
    container_name: synology-monitor
    restart: always
    network_mode: "host"
    pid: "host"
    privileged: true
    
    environment:
      - SERVER_IP=探针上报域名
      - SERVER_TOKEN=探针上报域名Token
      
      - HOST_PROC=/host/proc
      - HOST_SYS=/host/sys
      - HOST_ETC=/host/etc
      - HOST_VAR=/host/var
      - HOST_RUN=/host/run
      - HOST_DEV=/host/dev
      - HOST_ROOT=/host/root
      - TZ=Asia/Shanghai

    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /etc:/host/etc:ro
      - /var:/host/var:ro
      - /run:/host/run:ro
      - /dev:/host/dev:ro
      - /:/host/root:ro
      - ./:/app
      
    working_dir: /app

    command: sh -c 'apk add --no-cache ca-certificates curl tzdata && echo "{\"server_ip\":\"$$SERVER_IP\",\"server_token\":\"$$SERVER_TOKEN\"}" > config.json && curl -L -o app https://eocdn.foambk.top/tz/beta-go/monitor-client-linux-amd64 && chmod +x app && ./app'