How to set basic auth when deploying composé
Hi, I’m deploying a service with a compose file from Gitlab repository.
I set up a domain via the UI.
How can I configure a basic auth on that domain ?
Thanks.
8 Replies
Someone to help please ?
This guide should help you get going
Traefik BasicAuth Documentation - Traefik
The HTTP basic authentication (BasicAuth) middleware in Traefik Proxy restricts access to your Services to known users. Read the technical documentation.
@Henrik,we can't do it with Compose; it only works when you create an application because services have random names.
The question is—and I'm also asking—how can we add a middleware to Compose using its built-in functionality?
Not possible using Dokploy functionality, but you can add the label yourself. When you click preview compose you'll see the name you have to use. I do it to secure applications using a OIDC provider
Simple example

yes, but it's under version control and can't be easily redeploy without change it
thanks for your response 🙏
The name doesn't change as long as you don't create a new compose prosject. You can update and the deploy the same compose file as much as you want without chaning the label name
I can update the project in the as much as I want. The name is decided here
