Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get this working in a swarm? #18

Open
scyto opened this issue Nov 27, 2024 · 0 comments
Open

How to get this working in a swarm? #18

scyto opened this issue Nov 27, 2024 · 0 comments

Comments

@scyto
Copy link

scyto commented Nov 27, 2024

I could not get this working for me at all in my swarm.

this worked on my rpi

services:
  tailscale:
    image: tailscale/tailscale:latest
    hostname: tailscale-npm
    environment:
      - TS_AUTHKEY=redacted
      #- TS_EXTRA_ARGS=--advertise-tags=tag:container
      - TS_STATE_DIR=/var/lib/tailscale
      - TS_USERSPACE=false
      - TS_NO_LOGS_NO_SUPPORT=true
      - TS_DEBUG_MTU=1500
      - TS_HOSTNAME=tailscale-npm
    volumes:
      - /home/pi/tailscale:/var/lib/tailscale
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    restart: unless-stopped
  npm:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    environment:
      DISABLE_IPV6: 'true'
    volumes:
      - /home/pi/npm.data:/data
      - /home/pi/le:/etc/letsencrypt
    depends_on:
      - tailscale
    network_mode: service:tailscale

this did not work on the swarm, while i could ping the tailnet node it was as if no packets were being forwarded to the nginx proxy manager - does network_moder:service service-name work?

version: "3.2"
services:
  tailscale-npm:
    image: tailscale/tailscale:latest
    hostname: tailscale-npm
    environment:
      - TS_AUTHKEY=redacted
#      - TS_EXTRA_ARGS=--advertise-tags=tag:container
      - TS_STATE_DIR=/var/lib/tailscale
      - TS_USERSPACE=false
      - TS_NO_LOGS_NO_SUPPORT=true
      - TS_DEBUG_MTU=1500
      - TS_HOSTNAME=tailscale-npm
    volumes:
      - ts:/var/lib/tailscale
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    restart: unless-stopped
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      # These ports are in format <host-port>:<container-port>
      - '180:80' # Public HTTP Port
      - '1443:443' # Public HTTPS Port
      - '181:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP
    environment:
      DISABLE_IPV6: 'true'
    volumes:
      - data:/data
      - le:/etc/letsencrypt
    depends_on:
      - tailscale-npm
    network_mode: service:tailscale-npm
    deploy:
      mode: replicated
      replicas: 1    


volumes:
  data:
    driver: gluster-vol1
  le:
    driver: gluster-vol1
  ts:
    driver: gluster-vol1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant