docker-conpose use .env to change service names
I am using nginx-proxy so I can host multiple WordPress docker containers on a server. Because of this, the service name for the DB (MariaDB) has to be different for each of the WordPress docker-compose.yml files (there is one for each site). I am using .env to set variables so I can use the same docker-compose.yml (so I can easily change them all, i.e. use symbolic links).
Problem is you cant use a variable for the service name. i.e. the following is not allowed: version: '3' ... I did try COMPOSE_PROJECT_NAME which I thought appended to the service name but it does not (it only appends to the name of the created containers). Any idea how I can do this? Ben |
if this https://docs.docker.com/compose/environment-variables/ did not work for you: it looks like the only way is to generate them using a common template
|
All times are GMT -5. The time now is 01:29 AM. |