You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open you Terminal window and change to the 01-Traefik-Overview folder
Open the docker-compose.yml file in your favorite editor and review how Docker starts Traefik
From the 01-Traefik-Overview directory execute this command -> docker-compose up -d
Review the logs output docker-compose logs
2. Connect a new service to Traefik
Uncomment the below whoami section inside the docker-compose.yml. Review the whoami.yml file for the complete solution.
whoami:
# A container that exposes an API to show its IP addressimage: containous/whoami# We set a label to tell Traefik to assign a hostname to the new servicelabels:
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
Run docker-compose up -d whoami
Open a browser tab and paste whoami.docker.localhost or from a terminal window curl -H Host:whoami.docker.localhost http://127.0.0.1 and you should see the below results but with your IP addresses.
Hostname: 931789a57923IP: 127.0.0.1IP: 172.20.0.3RemoteAddr: 172.20.0.2:46648GET / HTTP/1.1Host: whoami.docker.localhostUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9Accept-Encoding: gzip, deflate, brAccept-Language: en-GB,en-US;q=0.9,en;q=0.8Cache-Control: max-age=0Sec-Fetch-Dest: documentSec-Fetch-Mode: navigateSec-Fetch-Site: noneSec-Fetch-User: ?1Upgrade-Insecure-Requests: 1X-Forwarded-For: 172.20.0.1X-Forwarded-Host: whoami.docker.localhostX-Forwarded-Port: 80X-Forwarded-Proto: httpX-Forwarded-Server: 07d5bffe1678X-Real-Ip: 172.20.0.1
3. Scale the Whoami service to 3x
Open you Terminal window and change to the 01-Traefik-Overview folder
Let's scale the whoami service to 3x instances by typing docker-compose up -d --scale whoami=3
Open a browser tab and paste whoami.docker.localhost or from a terminal window curl -H Host:whoami.docker.localhost http://127.0.0.1 and you should see the 3rd IP address update based on which service is responding.
4. Get to know the Traefik Dashboard
Open a browser tab and type or click: http://0.0.0.0:8080 to open the Traefik Dashboard