Portainer/Docker/Cloudflare issue
Hello!
I've been closely following Jim Hope's guide on setting up a Cloudflare Tunnel (https://jimhope.me/blog/2022/06/03/setting-up-cloudflare-tunnel/) but can't access my site despite ensuring all steps were correctly followed. This setup involves Docker, Portainer, and Cloudflare Tunnel configurations. If anyone has experience with Cloudflare or similar setups, your advice would be invaluable. Could someone help me figure out where things might be going wrong
Jim
Jim Hope
Setting Up Cloudflare Tunnel | Jim Hope
Access your home lab without opening ports on your firewall. We recently changed our internet service provider from Vodafone to TalkTalk and one of the thin ...
20 Replies
If you are running cloudflared in a docker container change localhost to either the container name if they are on the same docker network or the docker container IP address.
Alright, I've got it all working, but now my IPv4 with the port allows me to go to my site. it's not https but http. How do I fix this?
Like when you connect to the tunnel it uses http or connecting to the application uses http?
So, i've got all working correctly expect one thing. Whenever I try to setup two cotainers using one tunnel only of them will work. How do I go about fixing this?
Define only one will work. What error are you seeing? Is it showing an error message or just not routing to the container?
Well, only one cointainer works at a time
Like runs or can get traffic
runs but the the website is unreachable as one will only work that starts up first
Do you have a public hostname for both of them?
uh, no idea how to do that...
and do I need to use Apache?
can't I just use sub domains?
What I found to be the easiest way to route the containers is to setup a network and when you create the containers to use that network. Then you can
http://<container's name>:<port>
on the tunnels website.
it's important to use the container's port number not the external port number so -p 8080:80
the 80 to the right not the 8080 to the left.The image in your first post is a public hostname. You do use subdomains for each container you want to run
what network type/driver?
just the default
docker network create tunnel
should workAh alright
sorry I don't have portainer handy to check how to do it
It's okay 😄
all zeros for one container?
usually the image comes with an example for the command to run
-p <some port>:<some port>
or you can check the Dockerfile where it says EXPOSE