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

Include the server config in the compose file? #12

Open
plattrap opened this issue Jul 31, 2024 · 0 comments
Open

Include the server config in the compose file? #12

plattrap opened this issue Jul 31, 2024 · 0 comments

Comments

@plattrap
Copy link

One magic I had to work out is to double the "$" in the config content so that Docker does not try and expand the TS_CERT_DOMAIN string.

Also commented out the funnel line, because if it is in (even set to false), then the container shows as funnel enabled in the
control panel.

---
services:
  ts-nginx-test:
    image: tailscale/tailscale:latest
    container_name: ts-nginx-test
    hostname: nginx-test
    environment:
      - TS_AUTHKEY=${TS_AUTHKEY}
      - TS_EXTRA_ARGS=--advertise-tags=tag:container
      - TS_SERVE_CONFIG=/ts-nginx-test-config
      - TS_STATE_DIR=/var/lib/tailscale
    volumes:
      - ts-nginx-test-data:/var/lib/tailscale
      - /dev/net/tun:/dev/net/tun
    configs:
      - ts-nginx-test-config
    cap_add:
      - net_admin
      - sys_module
    restart: unless-stopped

  nginx-pid-test:
    image: nginx
    container_name: nginx-pid-test1
    network_mode: service:ts-nginx-test
    depends_on:
      - ts-nginx-test

volumes:
  ts-nginx-test-data:
    driver: local
    
configs:
  ts-nginx-test-config:
    content: |
      {
        "TCP": { "443": { "HTTPS": true } },
        "Web": {
          "$${TS_CERT_DOMAIN}:443": {
            "Handlers": {
              "/": {
                "Proxy": "http://127.0.0.1:80"
              }
            }
          }
        },
        "#AllowFunnel": { "$${TS_CERT_DOMAIN}:443": false }
      }
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