I currently have a hard time updating my traefik v1 containers to v2. I set up a traefik container with automatic http->https forwarding. Now I want to get portainer running with the following docker-compose file:
version: '3.3'
volumes:
portainer: {}
networks:
web:
external: true
services:
portainer:
image: portainer/portainer:latest
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
command: |
--no-analytics
--data /data
--admin-password "the_hashed_password"
-H unix:///var/run/docker.sock
networks:
web:
labels:
- "traefik.enable=true"
- "traefik.http.routers.portainer.entrypoints=websecure"
- "traefik.http.routers.portainer.rule=Host(`portainer.myserver.domain`)"
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
- "traefik.http.routers.portainer.tls=true"
- "traefik.http.routers.portainer.tls.certresolver=leresolver"
- "traefik.http.routers.portainer.middlewares=authportainer"
# generate with: sudo docker run --rm -ti xmartlabs/htpasswd user password
- "traefik.http.middlewares.authportainer.basicauth.users=myuser:my_hashed_password"
Now when I start the container with docker-compose up
I get:
portainer_1 | 2020/04/19 16:10:04 Starting Portainer 1.23.2 on :9000
...
portainer_1 | 2020/04/19 16:10:04 server: Listening on 0.0.0.0:8000...
Accessing http://portainer.myserver.domain
correctly forwards to https://portainer.myserver.domain
.
After authenticating with myuser
, an empty page is shown with a fading message toast "Failure. Unable to retrieve server settings and status". With traefik v1 the setup used to work. What I don't understand is if I need to do anything with port 8000 (which I didn't in the old working environment).
How does one debug such a scenario?
What is wrong with my docker-compose file?
P.S. For brevity, I omitted the traefik configuration file. If wanted, I will add it (it works with simple containers).