I’m using docker for development and use devcontainers with VSCode, Currently have a Container for development and 4x app containers that launch during test runs.
Devcontainer uses the file docker-compose.workspace.yml for the container, which adds it to the project myapp-devcontainer
I then have another docker-compose.yml which is run by my nox script
docker compose --project-name myapp-devcontainer -f docker-compose.yml up -d
At the end of the test, I want to have all the containers in docker-compose.yml to go down so I did
docker compose --project-name myapp-devcontainer -f docker-compose.yml down
but this also shuts down the docker-compose.workspace.yml container (which I assume is due to the “project” being supplied)
Is there a way that I can stop all the containers in docker-compose.yml that are part of the project, without downing the whole project?
docker compose down would not remove your devcontainer unless its name also listed in docker-compose.yml and part of the same compose project. Do you have service like that in docker-compose.yml?
As you can see, when i do the UP command it doesnt mention the “workspace” container but when i run the DOWN it does remove it. It is not mentioned at all in the docker-compose.yml which is why I couldn’t understand why it removes it.