Follow this link to start playing: https://docs.traefik.io/getting-started/quick-start/
version: '3'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.2
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
whoami:
# A container that exposes an API to show its IP address
image: containous/whoami
labels:
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
`docker-compose up -d reverse-proxy`
docker-compose up -d whoami
$ curl -H Host:whoami.docker.localhost http://127.0.0.1
$ docker-compose up -d reverse-proxy
(without whoami
in ymlfile)
able to see raw data http://localhost:8080/api/rawdata
able to see dashboard http://localhost:8080/
$ docker-compose up -d whoami
Traefik NOT detected the new container and updated its own configuration.
`curl -H Host:whoami.docker.localhost http://127.0.0.1`
curl: (7) Failed to connect to localhost port 80: Connection refused
I found whoami container is running.
Version: 2.2.0
Codename: chevrotin
Go version: go1.14.1
Built: 2020-03-25T17:32:57Z
OS/Arch: linux/amd64
Any help please?