Simple configuration for container with two open ports

Hi there,
I'm a new user and I have a question about ability to use an one docker container with two ports.


1. I create a file traefik.yml

# Docker configuration backend
    defaultRule: "Host(`{{ trimPrefix `/` .Name }}`)"

# API and dashboard configuration
  insecure: true

2. I started the Traefik proxy. My an app use two ports: 80 and 88

docker run -d -p 8080:8080 -p 80:80 -p 88:88  -v $PWD/traefik.yml:/etc/traefik/traefik.yml  -v /var/run/docker.sock:/var/run/docker.sock  traefik:v2.0

3. And I started my an app with --name xxx.

docker run -d --expose 80 --expose 88 --name xxx myapp:v1.2 bash

Now I go to and see my an app (a service 1 working on port 80), but if I go to my browser say me "This site can’t be reached".

And my a question is: How to configure Traefik so that the site runs on port 80 and 88 from one docker container?

There is documentation at For you particular problem and is a good start, but read through "Getting Started" too. Come back if anything is unclear.

1 Like