Upgrading my current v1 setup to v2, struggling with what should be a simple use case.
I have a container that exposes 2 ports, 2202 for main access and 2203 for admin access. With v1, defining multiple frontends and backends worked as expected but I just can't figure out the v2 way to accomplish this.
Defining multiple routers and services works fine but as soon as I try to link each router and service unexpected things happen such as the http routers disappearing from the dashboard and when defining multiple rules only the final one is seen.
Appreciate I'm missing something fundamental but any pointers on what I need to add to the docker-compose definition below to enable both mycont.mydomain.com pointing to port 2202 and mycont2.mydomain.com pointing to port 2203 would be great.
version: "3"
networks:
proxy:
external: true
services: │
mycont: │
image: mycont
container_name: mycont
restart: unless-stopped
networks:
- proxy
ports:
- 2202:2202
- 2203:2203
labels:
- traefik.enable=true
- traefik.http.routers.mycont.entrypoints=http
- traefik.http.routers.mycont.rule=Host(`mycont.mydomain.com`)
- traefik.http.routers.mycont.middlewares=https-redirect@file
- traefik.http.routers.mycont-secure.entrypoints=https
- traefik.http.routers.mycont-secure.rule=Host(`mycont.mydomain.com`)
- traefik.http.routers.mycont-secure.tls=true
- traefik.http.routers.mycont-secure.tls.certresolver=http
- traefik.http.routers.mycont-secure.service=mycont
- traefik.http.routers.mycont-secure.middlewares=secured@file
- traefik.http.services.mycont.loadbalancer.server.port=2202
- traefik.docker.network=proxy