Git Product home page Git Product logo

cf-tunnel-docker-example's Introduction

Cloudflare Tunnel x Docker Compose

This repository is a non-production (seriously don't use it in production) example of how to route traffic through a Cloudflare tunnel. It contains a docker compose specification for running:

  • A single Cloudflare tunnel
  • A Traefik Proxy instance to which the tunnel is routing exposed traefik with 3
  • Three instances of a dummy service (whoami) which are proxied & load-balanced by Traefik.

Quickstart

  • Create a tunnel in your Cloudflare account through https://one.dash.cloudflare.com//networks/tunnels.
  • In the creation process, select cloudflared (the utility we're using in Docker to create and operate the tunnel).
  • Select Docker in the installation process, you should have a token available from the command that's given for running cloudflared in Docker.
  • If you're prompted to provide a URL your tunnel should route to, it should be http://proxy:80.
  • Copy/Paste the .env.example file to .env and put your token there on the appropriate env variable.
  • In your Docker compose specification, replace foo.bar by the hostname you're running your tunnel under.
  • docker compose up & ๐ŸŽ‰. You should be set !

What do I have access to

  • On the domain routed to your tunnel, you should have access to Traefik routing to your three whoami instances. Let's say I'm routing my tunnel from tunnel.crossbone.cc, you can reach tunnel.crossbone.cc/whoami.
  • On your local machine, you can access Traefik's dashboard on http://127.0.0.1:8080/dashboard/.

Issues

If you have an issue you can just create an issue, I'll do my best to reply to it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.