services:
  cloudflared:
    image: cloudflare/cloudflared:latest
    container_name: cloudflare-tunnel
    restart: unless-stopped
    command: tunnel --no-autoupdate run --token ${CLOUDFLARE_TUNNEL_TOKEN}
    depends_on:
      - tailscale
    labels:
      - diun.enable=true
  tailscale:
    container_name: tailscale
    image: tailscale/tailscale:stable
    volumes:
      - ./tailscale:/var/lib # State data will be stored in this directory
      - /dev/net/tun:/dev/net/tun # Required for tailscale to work
    cap_add:
      # Required for tailscale to work
      - net_admin
      - sys_module
    environment:
      - TS_AUTHKEY:${TAILSCALE_AUTHKEY}
      - TS_SOCKET:${TAILSCALE_SOCKET}
    command: tailscaled
    privileged: true
    restart: unless-stopped
    labels:
      - diun.enable=true
networks: {}
