I'm using the following files
docker-compose.yml
version: '3'
services:
frontproxy:
image: traefik:2.2.6
command: --api --docker --docker.swarmmode # Enables the web UI and tells Træfik to listen to docker
ports:
- "80:80"
- "443:443"
volumes:
- /path/to/logs:/logs
- /path/to/certs:/etc/ssl:ro
- /path/to/traefik.toml:/etc/traefik/traefik.toml:ro
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
networks:
- traefik-net
deploy:
placement:
constraints:
- 'node.role == manager'
- 'node.platform.os == linux'
labels:
traefik.enable: 'true'
traefik.http.services.frontproxy.loadbalancer.server.port: 8080 # API (web UI)
traefik.http.routers.router0.rule: Host(`traefik.my-domain.com`)
traefik.docker.network: traefik-net
networks:
traefik-net:
external: true
traefik.toml
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
# Redirect to https
[http.middlewares]
[http.middlewares.test-redirectscheme.redirectScheme]
scheme = "https"
permanent = true
[[tls.certificates]]
# wildcard certificate *.my-domain.com
certFile = "/etc/ssl/my-domain.com.crt"
keyFile = "/etc/ssl/my-domain.com.key"
[providers]
providersThrottleDuration = "2s"
[providers.docker]
watch = true
swarmMode = true
swarmModeRefreshSeconds = "15s"
exposedByDefault = false
[api]
insecure = true
[log]
filePath = "/logs/error.log"
[accessLog]
bufferingSize = 0
filePath = "/dev/stdout"
I create the network (used by other stacks)
docker network create --driver=overlay traefik-net
and run
docker stack deploy frontproxy -c docker-compose.yml
I expect to be able to access Traefiks web UI at https://traefik.my-domain.com, but I get
\"frontproxy-frontproxy\" error: port is missing" providerName=docker container=frontproxy-frontproxy-le6qibl1w2vi9a5cvp7vcx6o0
in /path/to/logs/error.log
What am I missing?