Whether the Docker modified file needs to be restarted (command details)

  • 2020-05-27 07:35:01
  • OfStack

Whether the Docker modified file needs to be restarted

Do you need to restart the modified file of Docker? When doing projects, I often modify the file. I don't know much about the command, but if I use it, I will try.

I need to modify the code in the project of phase 1. I used to use "try 1" every time to figure out whether to start or not. Now I will summarize what needs to be started under what circumstances

1. First familiarize yourself with the role of each command

docker-compose up-d - will start and run all containers in the background docker-compose stop - stop an already running container, but do not delete it, and restart it via docker-compose start docker exec -it XX bash - makes it easy for the user to have the container execute a specified command outside of the container docker logs XX - view the log of the XX container

2, start,

Modify the foreground code

This includes code written using React and Reflux, modified by simply running the following command

$ npm run webpack
Repackage the code to set the exception to automatic packaging

Modify the background code

Including the code in web-api, paper-api and other containers, you need to restart the corresponding containers

For example, the code in web-api has been modified to run under assembly

$ service docker start
Execute 1 at the beginning

$ docker-compose up -d
Start all containers, execute 1 time

$ docker-compose restart web-api
Restart web-api to give effect to the modified code

Thank you for reading, I hope to help you, thank you for your support of this site!

Related articles: