All we have such a dashboard in Docker Desktop, where we can look at containers that were started with Docker-Compose.
At the picture below I have 3 containers that were started with one docker-compose1.yml (frontend, backend, db).
The fourth container db-v4 that was created via another docker-compose2.yml file.
So my question is -- How can I separate then into this dashboard? I have tried to use different networks, but this didn't work out.
For example, first container will be in one group and other three are in another group
CodePudding user response:
Normally it is sorted by project name. Per default the project name is the folder name where the yml-file is located. You may:
- Use different folders for yml-files
- Or set name by env:
#.env.1 listing:
COMPOSE_PROJECT_NAME=MyProject1
#.env.2 listing:
COMPOSE_PROJECT_NAME=MyProject2
# Run with
docker-compose --env-file .env.1 -f project1.yml up
docker-compose --env-file .env.2 -f project2.yml up
By the way: It is not just optics. Docker uses this project name to share resources and handles it as one bundle. If they are separate logical units you SHOULD use different names.