Restart Single Container While Using Docker Compose


When you’re running a set of containers with Docker Compose there are times that you need to restart just one of those containers. Let’s say for example that you need to restart your NodeJS server to read in a new environment setting. You could stop and restart the entire stack OR you could run this command:

Find the container

docker ps
docker container restart < container id >

This will restart the container, reading in new settings while maintaining all of the configurations from Docker Compose. For more information, here are the Docker Docs