networks:
  infra-net:
    driver: bridge
  ix-databases_shared-databases:
    external: true
  pangolin:
    external: true

services:

  newt:
    container_name: ix-newt-newt-1
    image: fosrl/newt:latest
    restart: unless-stopped
    networks:
      - pangolin
    environment:
      NEWT_ID: ${NEWT_ID}
      NEWT_SECRET: ${NEWT_SECRET}
      PANGOLIN_ENDPOINT: ${PANGOLIN_ENDPOINT}
      TZ: ${TZ}
    security_opt:
      - no-new-privileges:true
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /mnt/tank/docker/appdata/newt:/app/data

  homepage:
    container_name: ix-homepage-homepage-1
    image: ghcr.io/gethomepage/homepage:latest
    restart: unless-stopped
    networks:
      - infra-net
      - pangolin
    ports:
      - "3300:3000"
    environment:
      TZ: ${TZ}
    volumes:
      - /mnt/tank/docker/appdata/homepage:/app/config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3000/ >/dev/null 2>&1 || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

  dockhand:
    container_name: ix-dockhand-dockhand-1
    image: fnsys/dockhand:latest
    restart: unless-stopped
    networks:
      - infra-net
      - pangolin
    ports:
      - "3230:3000"
    environment:
      TZ: ${TZ}
      PUID: ${PUID}
      PGID: ${PGID}
    volumes:
      - /mnt/tank/docker/appdata/dockhand:/app/data
      - /var/run/docker.sock:/var/run/docker.sock:ro
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://127.0.0.1:3000/ || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

  uptime-kuma:
    container_name: uptime-kuma
    image: louislam/uptime-kuma:2
    restart: unless-stopped
    networks:
      - infra-net
      - ix-databases_shared-databases
      - pangolin
    ports:
      - "3001:3001"
    environment:
      TZ: ${TZ}
      DB_TYPE: mariadb
      DB_HOST: shared-mariadb
      DB_PORT: 3306
      DB_NAME: ${UPTIMEKUMA_DB_NAME}
      DB_USERNAME: ${UPTIMEKUMA_DB_USER}
      DB_PASSWORD: ${UPTIMEKUMA_DB_PASS}
    volumes:
      - /mnt/tank/docker/appdata/uptime-kuma:/app/data
    healthcheck:
      test: ["CMD-SHELL", "curl -sfL http://127.0.0.1:3001/ || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

  tailscale:
    container_name: ix-tailscale-tailscale-1
    image: ghcr.io/tailscale/tailscale:v1.94.2
    restart: unless-stopped
    networks:
      - infra-net
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    devices:
      - /dev/net/tun:/dev/net/tun
    environment:
      TZ: ${TZ}
      TS_HOSTNAME: ${TS_HOSTNAME}
      TS_AUTHKEY: ${TS_AUTHKEY}
      TS_STATE_DIR: /var/lib/tailscale
      TS_USERSPACE: "false"
      TS_ACCEPT_DNS: "false"
      TS_AUTH_ONCE: "true"
      TS_EXTRA_ARGS: "--advertise-exit-node=false --reset=false --accept-routes=true"
      TS_SOCKET: /var/run/tailscale/tailscaled.sock
      NVIDIA_VISIBLE_DEVICES: void
    volumes:
      - /mnt/docker-ssd/docker/appdata/tailscale:/var/lib/tailscale

  netdata:
    container_name: ix-netdata-netdata-1
    image: netdata/netdata:v2.9.0
    restart: unless-stopped
    networks:
      - infra-net
    pid: host
    cap_add:
      - SYS_PTRACE
      - SYS_ADMIN
    security_opt:
      - apparmor:unconfined
    environment:
      TZ: Etc/UTC
      NETDATA_CLAIM_TOKEN: ${NETDATA_CLAIM_TOKEN}
      NETDATA_CLAIM_URL: https://app.netdata.cloud
      NETDATA_CLAIM_ROOMS: ${NETDATA_CLAIM_ROOMS}
      NETDATA_LISTENER_PORT: 19999
    volumes:
      - /mnt/docker-ssd/docker/appdata/netdata/config:/etc/netdata
      - /mnt/docker-ssd/docker/appdata/netdata/lib:/var/lib/netdata
      - /mnt/docker-ssd/docker/appdata/netdata/cache:/var/cache/netdata
      - /etc/passwd:/host/etc/passwd:ro
      - /etc/group:/host/etc/group:ro
      - /etc/localtime:/etc/localtime:ro
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /etc/os-release:/host/etc/os-release:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
