Hello,
I'm trying to run Portainer through Traefik, I have a basic configuration without really anything complicated.
I'm using Traefik CE, using a config.yml (excerpt below) on a Debian Linux machine.
I am using a config.yml proxy configuration:
...
http:
routers:
portainer:
service: portainer
rule: Host(`portainer.moi.localhost`)
entryPoints:
- websecure
tls: true
services:
portainer:
loadBalancer:
servers:
- url: http://portainer:9000 # NO WAY... "Bad Gateway"
# - url: http://filebrowser:8080 # WORKS FINE.
TLS is working fine, Certificates are ok, traefik is handing correctly all the stacks using label directives in docker-compose files, except with the portainer driven by the config file.
The redirection is ok : I verified it by trying to reach a container that works (filebrowser). Everything is ok. When I apply it to the portainer container, and it fails with a "Bad Gateway".
I cannot figure what I am missing
The filebrowser container has been running using a docker-compose in a portainer stack and runs in a "myNetwork" network.
The portainer container is run outside of portainer using a shell. It's in the "bridge" network. It has been ran this way:
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
What's wrong with it? I don't want to run portainer in its own stack next to traefik as it says on the portainer website because we lose control from portainer of everything that is created outside portainer.