Hi! I'm a newbie and trying to understand traefik. I have been playing around with their default example as a docker container. In there we're running a whoami service just to demonstrate stuff works. And both the traefik dashboard and the whoami service runs fine. I can even access it on whoami.localhost.
However when I move out my whoami service to its own folder and docker-compose.yml the service is no longer accessible on whoami.localhost and I'd like to understand why that is?
One thing that bugs me though is that this set-up I've done now works fine on my server. But it is no longer accessible from within my local network. I'm thinking if it has anything with the way I set up my docker network? I can see all my containers within the network I've created.
Can you explain what is not working? You can only interact with containers when you are in a container yourself, that is attached to the Docker network.
There is an attachable option for overlay networks which can be set to true to attach other containers that don't belong to a service or a stack defined in the same file, but I think it's only relevant when using Docker Swarm.
I'm sorry if I was being unclear, I'll try explaining.
While my Traefik Dashboard is accessible throughout my local network on it's ip: http://192.168.1.249:8080/dashboard/ my other services only get a server local ip, that I can't reach from another computer in the network. If that makes sense?
Your routing is done via domain/hostname (like whoami.localhost).
If you want to use that from another computer, you have to make sure that domain/hostname resolves to the correct IP. Either you enter something into your local hosts file or you setup your local DSL router with those DNS entries.
Alternatively you can setup an external DNS server and let a domain point to your local private IP. It will just not be available from outside your network.