version: '3.8'

services:
  dashboard-keller:
    build: .
    container_name: dashboard-keller
    hostname: dashboard-keller
    restart: unless-stopped
    network_mode: host
    volumes:
      - ./src:/app/src
      - ./wisen_fetcher.rb:/app/wisen_fetcher.rb
      - ./wisen_proxy_server.rb:/app/wisen_proxy_server.rb
      - ./entrypoint.sh:/app/entrypoint.sh
      - ./.env:/app/.env
    environment:
      - TZ=Europe/Madrid

  tailscale-funnel:
    image: tailscale/tailscale:latest
    container_name: tailscale-funnel
    network_mode: host
    environment:
      - TS_STATE_DIR=/var/lib/tailscale
      - TZ=Europe/Madrid
      - TS_EXTRA_ARGS=--snat-subnet-routes=false --accept-dns=true --hostname=dashboard-keller
    volumes:
      - tailscale-data:/var/lib/tailscale
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - net_admin
      - sys_module
    restart: unless-stopped

volumes:
  tailscale-data:
