Last active
March 7, 2024 00:31
-
-
Save j0sh/b1971bfbbffeb92709cf096fb788f70c to your computer and use it in GitHub Desktop.
Passing tunnel tokens into cloudflared via Docker Compose secrets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
tunnel: | |
build: | |
dockerfile: Dockerfile.cloudflared | |
restart: unless-stopped | |
secrets: | |
- tunnel_prod_token | |
secrets: | |
tunnel_prod_token: | |
file: /path/to/tunnel/token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox:1.36.1-uclibc as busybox | |
FROM cloudflare/cloudflared:2023.8.2 | |
COPY --from=busybox /bin/sh /bin/sh | |
COPY --from=busybox /bin/cat /bin/cat | |
ENTRYPOINT [ "/bin/sh", "-c", "export TUNNEL_TOKEN=$(cat /run/secrets/tunnel_prod_token) ; cloudflared --no-autoupdate tunnel run" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment