tailscale-dev / docker-guide-code-examples

https://tailscale.com/blog/docker-tailscale-guide
116 stars 32 forks source link

healthcheck - when side docker starts #8

Closed shuther closed 3 months ago

shuther commented 5 months ago

I created a docker compose file with tailscale and another docker (litellm). It seems tailscale takes a bit longer to start and it is causing a name resolution issue when litellm starts (so it exits). Maybe there is another issue on top.

However, would it be possible to get in the example (docker-compose.yml) a section with: An healthcheck we can add to the ts-docker (maybe a ping to the hello service) to confirm it started (above all the 1st time when it needs to validate the token?). I am not sure about the best way to do it?

shuther commented 5 months ago

I found the other problem, tailscale docker failed because of: backend error: requested tags [tag:container] are invalid or not permitted

getting this healthcheck would help.

shuther commented 5 months ago

Just to add on the issue above and maybe I missed the step: it is important to had a tag called container in the ACL Even when I selected a tag (not container) when I created the token, it seems it is required to have this tag to get tailscale to work (not sure if expected)

shuther commented 5 months ago

to help others, I am using:

    healthcheck:
      test: ["CMD-SHELL", "tailscale", "-c", "1", "hello.ts.net"]
      interval: 10s
      timeout: 2s
      retries: 5
      start_period: 7s # Estimated time to boot.

But Maybe there is a better approach that doesn't depend on hello?

ironicbadger commented 3 months ago

it is important to had a tag called container in the ACL

Tags are required when using an OAuth token.