The difference of Dockerfile / docker-compose after changing docker entrypoint to bash

the image entrypoint built by Dockerfile is set to bash, and the created container will exit after running. I understand that there is no foreground work process, so the container exits.

what puzzles me is that after switching to docker-compose choreography, the container created after setting entrypoint to bash in the docker-compose.yaml file will not exit? I can log in to the container through docker exec-it container_name bash and ask for tips.

Apr.28,2022
Menu