If the docker service name is the same, the compose file that runs second will recreate the first file's container.
This may lead to issues such as data loss when opening the second container simultaneously.
There are two possible solutions: one is to replace the service name in the compose file, and the other is to add the parameter --project-name to specify an alternate project name for docker compose. I chose the first solution in this pull request because it is easier to understand.
If the docker service name is the same, the compose file that runs second will recreate the first file's container. This may lead to issues such as data loss when opening the second container simultaneously.
There are two possible solutions: one is to replace the service name in the compose file, and the other is to add the parameter
--project-name
to specify an alternate project name for docker compose. I chose the first solution in this pull request because it is easier to understand.Reference: https://github.com/docker/compose/issues/7403