I know this seems to be repetitive in the community, and I've tried some solutions, but I couldn't display the dashboard in secure mode.
What corrections do I need to make to this file to display it.
version: '3.8'
services:
reverse-proxy:
container_name: traefik
image: traefik
command:
- '--api.dashboard=true'
- '--providers.docker=true'
- '--providers.docker.endpoint=unix:///var/run/docker.sock'
- '--providers.docker.exposedbydefault=false'
- '--providers.docker.network=public-network'
- '--entrypoints.web.address=:80'
- '--entrypoints.web.http.redirections.entryPoint.to=websecure'
- '--entrypoints.web.http.redirections.entryPoint.scheme=https'
- '--entrypoints.websecure.address=:443'
- '--certificatesresolvers.letsencryptresolver.acme.httpchallenge=true'
- '--certificatesresolvers.letsencryptresolver.acme.httpchallenge.entrypoint=web'
- '--certificatesresolvers.letsencryptresolver.acme.email=cleberw.jr@gmail.com'
- '--certificatesresolvers.letsencryptresolver.acme.storage=/etc/traefik/letsencrypt/acme.json'
- '--log.level=DEBUG'
- '--log.format=common'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.dashboard.rule=Host(`traefik.codechat.dev`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))'
- 'traefik.http.routers.dashboard.tls.certresolver=letsencryptresolver'
- 'traefik.http.routers.dashboard.service=api@internal'
- 'traefik.http.routers.dashboard.middlewares=auth'
- 'traefik.http.middlewares.auth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
- 'vol_certificates:/etc/traefik/letsencrypt'
ports:
- '80:80'
- '443:443'
networks:
- public-network
whoami:
image: traefik/whoami
labels:
- 'traefik.http.routers.whoami.rule=Host(`traefik.codechat.dev`) && PathPrefix(`/whoami`)'
- 'traefik.http.routers.whoami.tls.certresolver=letsencryptresolver'
networks:
- public-network
volumes:
vol_shared:
vol_certificates:
networks:
public-network:
external: true