I would not use Docker Compose to name the image as if it were an image pulled from a repository. You can, it is your choice, but I don’t think it helps much. You can just let Docker Compose to generate the image name which contains the name of the project and the service it was built for. It is the same with the container name. You set the name to “container-php-eb” Using “container” in the name seems redundant. Of course it is a container. If it is the project name for some reason that the autogenerated name would be similar. I only name the containers manually when I know I need to set its name in an other application’s configuration where I can’t dinamically detect the name.
I don’t see why you want to stop and remove containers and volumes using docker without docker compose. Docker compose could stop your services referring to the service name without knowing the ful name of the containr. You could also remove all the containers and networks using only one command:
docker-compose down --volumes
I also don’t understand why you would stop your containers then remove them (you could do it with one command, but I guess this is not the point), then prune the whole system which willremove everything, including containers.
So honestly I think I don’t understand the question. The commands that you quoted indeed working commands, but I can’t see how those help you or how your compose file helps you to use those commands.
Are you aware of these commands as well?
docker container prune
docker volume prune
docker image prune
Using docker stop $(...)
was what I used some years ago but I don’t actually need it anymore when I want to delete everything. When I want to delete containers conditionally, then it can help.