Hello all,
I got started into Traefik while choosing a reverse proxy to go with Portainer.
The portainer website offers the following docker-composer.yml that I updated to match my needs, but no matter what I tried, I was unable to access the dashboard. After many attempts, I decided to create a subdomain to access the dashboard.
What I am missing in the composer file below?
Additional info:
I tried to follow all the subdomain/dashboard questions from the forum and stackoverflow, but did not manage to solve this issue!
Portainer is working fine under https://portainer.MYDOMAIN.com
Thanks again for the help, @bluepuma77
I tried all the suggestions and nothing worked.
At the end, I gave up and used the simple Traefik example.
Dashboard and WhoAmI are working as expected.
The new issue now is how to get Portainer and other docker containers running.
I tried to follow the documentation from Traefik Docker Routing Documentation - Traefik, specially the part under "Specify a Custom Port for the Container":
version: "3"
services:
my-container:
# ...
labels:
- traefik.http.routers.my-container.rule=Host(`example.com`)
# Tell Traefik to use the port 12345 to connect to `my-container`
- traefik.http.services.my-service.loadbalancer.server.port=12345
. Until now I was not successful. My current docker-compose.yml for Portainer:
portainer:
image: portainer/portainer-ce:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
labels:
# Frontend
- traefik.enable=true"
- traefik.http.routers.frontend.rule=Host(`portainer.MYDOMAIN.com`)
- traefik.http.routers.frontend.entrypoints=websecure #Is this needed?
- traefik.http.services.frontend.loadbalancer.server.port=9000
- traefik.http.routers.frontend.service=frontend
- traefik.docker.network=proxy #"proxy" is my network name from traefik
# Edge
- traefik.http.routers.edge.rule=Host(`edge.MYDOMAIN.com`)
- traefik.http.routers.edge.entrypoints=websecure #Is this needed?
- traefik.http.services.edge.loadbalancer.server.port=8000
- traefik.http.routers.edge.service=edge
volumes:
portainer_data:
The error I am getting is Gateway Timeout. Which I found on forums to be related to the used network. I tried to overcome this by using the Traefik Docker Routing Documentation - Traefik.