This is a super quick post to keep track how I solved the problem to run CloudFlare tunnels with my QNAP Container station.
This isn’t meant to be a step-by-step or theoretical guide – there are plenty of those available on the Web (like this one).
I’m sharing the docker compose that I used:
version: "3.8"
services:
cloudflared:
image: cloudflare/cloudflared
container_name: cloudflare-tunnel
restart: unless-stopped
network_mode: host
command: tunnel run
environment:
- TUNNEL_TOKEN= {ENTER YOUR TOKEN HERE}
The trick is in that network_mode: host that tells to docker to use the host networking instead of the internal container network.
So as an application in CloudFlare you have to configure the IP of your QNAP and the port used by the service.
Easy.