Skip to content

Instantly share code, notes, and snippets.

@j0sh
Last active March 7, 2024 00:31
Show Gist options
  • Save j0sh/b1971bfbbffeb92709cf096fb788f70c to your computer and use it in GitHub Desktop.
Save j0sh/b1971bfbbffeb92709cf096fb788f70c to your computer and use it in GitHub Desktop.

Revisions

  1. j0sh revised this gist Jan 23, 2024. No changes.
  2. j0sh created this gist Jan 23, 2024.
    5 changes: 5 additions & 0 deletions Dockerfile.cloudflared
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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" ]
    11 changes: 11 additions & 0 deletions compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    services:
    tunnel:
    build:
    dockerfile: Dockerfile.cloudflared
    restart: unless-stopped
    secrets:
    - tunnel_prod_token

    secrets:
    tunnel_prod_token:
    file: /path/to/tunnel/token