Combine 2 docker tunnels into 1

Hi,

I’ve got 2 tunnels pointing to 2 different services inside my Synology NAS.
I followed the Cloudflare instructions and now have 2 docker containers running. There’s nothing special, a subdomain pointing to my NAS IP and a different port for the 2 services.

Is there an easy way to docker-compose and combine the 2 so I end up with just 1 docker instance running?

You should be able to just combine the configs into one and run a single connector with the combined config.

Should?

Well this is a combination which doesn’t work-

version: "3.4"
services:
  cloudflared:
    container_name: cftunnels
    image: cloudflare/cloudflared

    command: tunnel --no-autoupdate run --token XXX
    command: tunnel --no-autoupdate run --token ZZZ

    restart: unless-stopped

Have you done this or have an example?

If you are using remote tunnels, then you need to merge the configs in the zero trust dashboard. You can only run one tunnel connector per docker container. These are the configs found at https://dash.teams.cloudflare.com/<your account id>/access/tunnels

The docker compose file would only contain

version: "3.4"
services:
  cloudflared:
    container_name: cftunnels
    image: cloudflare/cloudflared

    command: tunnel --no-autoupdate run --token XXX

    restart: unless-stopped
1 Like

OK I’m a dummy. I can add more than one hostname in a tunnel lol
Thanks for your patience

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.