Edit: I have updated my configuration to reflect Henrik Hoegh's tutorial. I am still running into issues.
I am setting up a local development environment with lots of docker containers running applications. I am using Traefik to manage and locally proxy these containers (each container having a named local URL). Right now my setup is as follows
Traefik.toml
[web]
address = ":8088"
[web.statistics]
################################################################
# Docker configuration backend
################################################################
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "local.io"
watch = true
# Expose containers by default in traefik
exposedbydefault = true
# Use the IP address from the bound port instead of the inner network one. For specific use-case :)
usebindportip = true
# Use Swarm Mode services as data provider
swarmmode = false
Docker-compose.yml file for container
...
container_name: mcserviceface
labels:
- "traefik.port=8080"
...
I also have added local.io
and mcserviceface.local.io
(both pointing to my local machine) to my ect/hosts
file.
When I start up the Traefik container and the mcserviceface container, it shows up on the Traefik dashboard, but it does not show the URL as mcserviceface.local.io
rather something like http://185.28.0.3:80
. I also hit a ERR_CONNECTION_TIMED_OUT
when I follow that link.
How do I resolve both of these issues?
Edit: I have made sure that both containers on are on the same docker network via docker network connect ...
. It does not resolve the issue.
docker network connect
for this, instead the container should join the network as part of it's creation, preferably inside the compose file. And you'll also want to pass thetraefik.docker.network
label to specify which network if the container is on more than one.