mirror of
https://github.com/jbowdre/tailscale-docker.git
synced 2024-11-27 12:02:18 +00:00
add funnel support
This commit is contained in:
parent
abe2074cbc
commit
9b9871f435
4 changed files with 12 additions and 1 deletions
|
@ -3,3 +3,4 @@ export TS_AUTHKEY=""
|
|||
export TS_HOSTNAME=""
|
||||
export TS_OPT=""
|
||||
export TS_SERVE_PORT=""
|
||||
export TS_FUNNEL_PORT=""
|
|
@ -8,6 +8,7 @@ services:
|
|||
TS_HOSTNAME: ${TS_HOSTNAME:-ts-docker}
|
||||
TS_STATE: "/var/lib/tailscale/tailscale.state" # store ts state in a local volume
|
||||
TS_SERVE_PORT: ${TS_SERVE_PORT:-} # optional port to proxy with tailscale serve (ex: '80')
|
||||
TS_FUNNEL_PORT: ${TS_FUNNEL_PORT:-} # optional port to publish publicly with tailscale funnel (ex: '80')
|
||||
volumes:
|
||||
- ./ts_data:/var/lib/tailscale/
|
||||
myservice:
|
||||
|
|
|
@ -12,4 +12,9 @@ if [ -n "${TS_SERVE_PORT}" ]; then
|
|||
tailscale serve --bg "${TS_SERVE_PORT}"
|
||||
fi
|
||||
fi
|
||||
if [ -n "${TS_FUNNEL_PORT}" ]; then
|
||||
if ! tailscale funnel status | grep -q -A1 '(Funnel on)' | grep -q "${TS_FUNNEL_PORT}"; then
|
||||
tailscale funnel --bg "${TS_FUNNEL_PORT}"
|
||||
fi
|
||||
fi
|
||||
wait ${PID}
|
||||
|
|
|
@ -21,6 +21,10 @@ spec:
|
|||
value: "tailscale-docker-k8s-simple"
|
||||
- name: TS_STATE
|
||||
value: "mem:"
|
||||
- name: TS_SERVE_PORT
|
||||
value: "${TS_SERVE_PORT:-}"
|
||||
- name: TS_FUNNEL_PORT
|
||||
value: "${TS_FUNNEL_PORT:-}"
|
||||
resources:
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
|
|
Loading…
Reference in a new issue