How can the start and stop of container avoid service interruption in docker production environment?

  docker, question

I have seen some articles that use docker for continuous integration. The code of the program is encapsulated in an image. Each time a new submission is made, a new image will be generated. Then stop the container, remove the Container, pull the new image, run container on the host running the Container. Will this process not cause service interruption in operation?

I now have a project organized by docker-compose. If I also want to package the code in image, is there any suitable process for updating the production environment code?

Two solutions are recommended
1. docker only deploys the environment. All programs and configuration files are volume outside, and programs can be updated without restarting docker.
2. Deploy master-standby docker online, switch master-standby and update one by one
The first method is recommended. Generally, the online development environment will not move. Even if the dependency needs to be increased, it can be executed in docker.