-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
I was looking into ways to prevent my staging environment from being listed on Google. I found out that the easiest way to do this apparently is to use traefik's BasicAuth middleware and require a user name and password for the staging environment. I really like the easy setup in this repository, having only one docker-compose file that I can use to deploy to production and staging. However, I am having trouble coming up with a clean way to integrate BasicAuth only for staging.
My domains and stack names have the following pattern:
Staging
- Domain: staging.xxx.com
- Stack Name: xxx-stag
Production
- Domain: xxx.com
- Stack Name: xxx-prod
However, these are specified in the .gitlab-ci.yml and only injected during the deployment phase of the CI/CD pipeline.
How would I achieve this in a clean way, ideally reusing the variables from the .env file and not hard coding any stack name for the staging stack into the docker-compose file?