traefik : how to use basic auth when using docker-compose?

Viewed 4672

I'm trying to use traefik with docker compose.

According to the threads I've seen on their site, you could use something like this :

mytest-steph: image: myimage ports: - "45001:45001" labels: - "traefik.backend=test_steph" - "traefik.frontend.rule=Host:test.mydomain.com;PathPrefix:/myprefix" - "traefik.backend.port=8080" - "traefik.frontend.auth.basic=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"

But when I launch docker-compose up, I get : WARNING: The apr1 variable is not set. Defaulting to a blank string. WARNING: The H6uskkkW variable is not set. Defaulting to a blank string. WARNING: The IgXLP6ewTrSuBkTrqE8wj variable is not set. Defaulting to a blank string.

Does anyone achieve to use basic auth like that ?

2 Answers
Related