HiveBrain v1.2.0
Get Started
← Back to all entries
patterndockerMinor

Traefik configuration issue with local proxy

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
traefiklocalproxywithissueconfiguration

Problem

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.

Solution

Make sure you connect your traefik instance to the client docker-network (as specified on the bottom of this page):

When running inside a container, Træfik will need network access through:

docker network connect  

Code Snippets

When running inside a container, Træfik will need network access through:

docker network connect <network> <traefik-container>

Context

StackExchange DevOps Q#3177, answer score: 1

Revisions (0)

No revisions yet.