As far as others showsOthers have shown how to start/up containers together, however this is how you can restart and stop them separately:individually.
for restarting specific container:
docker-compose restart <container_name>
docker-compose restart -t 10 <container_name> # Container will restart after 10 seconds
Restart a Container
# restart immediately
docker-compose restart <container_name>
# restart after a 10s delay
docker-compose restart -t 10 <container_name>
for only just stop container:
docker-compose stop <container_name>
docker-compose stop -t 10 <container_name> # Container will stop after 10
Stop a Container
# stop immediately
docker-compose stop <container_name>
# stop after a 10s delay
docker-compose stop -t 10 <container_name>
and final word is forFor those who want to make changes without downtime, you can build a new image and make changes without any stop start/start with thisthe following command but it will build all Dockerfile in docker-compose.yml file:
docker-compose up -d --build
docker-compose up -d --build