Skip to main content
Fix comment typo formatted code
Source Link
Blindspots
  • 3.2k
  • 2
  • 18
  • 23

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 secondsRestart 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

As far as others shows how to start/up containers this is how you can restart and stop them separately:

for restarting specific container:
docker-compose restart <container_name>
docker-compose restart -t 10 <container_name> # Container will restart after 10 seconds

for only just stop container:
docker-compose stop <container_name>
docker-compose stop -t 10 <container_name> # Container will stop after 10

and final word is for those who want make changes without downtime, you can build new image and make changes without any stop start with this command but it will build all Dockerfile in docker-compose.yml file:
docker-compose up -d --build

Others have shown how to start/up containers together, however this is how you can restart and stop them individually.

Restart a Container

# restart immediately
docker-compose restart <container_name>

# restart after a 10s delay
docker-compose restart -t 10 <container_name> 

Stop a Container

# stop immediately  
docker-compose stop <container_name>

# stop after a 10s delay  
docker-compose stop -t 10 <container_name>

For those who want to make changes without downtime, you can build a new image and make changes without any stop/start with the following command but it will build all Dockerfile in docker-compose.yml file:

docker-compose up -d --build

As far as others shows how to start/up containers this is how you can restart and stop them separately:

for restarting specific container:
docker-compose restart <container_name>
docker-compose restart -t 10 <container_name> # Container will restart after 10 seconds

for only just stop container:
docker-compose stop <container_name>
docker-compose stop -t 10 <container_name> # Container will restartstop after 10

and final word is for those who want make changes without downtime, you can build new image and make changes without any stop start with this command but it will build all Dockerfile in docker-compose.yml file:
docker-compose up -d --build

As far as others shows how to start/up containers this is how you can restart and stop them separately:

for restarting specific container:
docker-compose restart <container_name>
docker-compose restart -t 10 <container_name> # Container will restart after 10 seconds

for only just stop container:
docker-compose stop <container_name>
docker-compose stop -t 10 <container_name> # Container will restart after 10

and final word is for those who want make changes without downtime, you can build new image and make changes without any stop start with this command but it will build all Dockerfile in docker-compose.yml file:
docker-compose up -d --build

As far as others shows how to start/up containers this is how you can restart and stop them separately:

for restarting specific container:
docker-compose restart <container_name>
docker-compose restart -t 10 <container_name> # Container will restart after 10 seconds

for only just stop container:
docker-compose stop <container_name>
docker-compose stop -t 10 <container_name> # Container will stop after 10

and final word is for those who want make changes without downtime, you can build new image and make changes without any stop start with this command but it will build all Dockerfile in docker-compose.yml file:
docker-compose up -d --build

Source Link
Iman
  • 171
  • 1
  • 2

As far as others shows how to start/up containers this is how you can restart and stop them separately:

for restarting specific container:
docker-compose restart <container_name>
docker-compose restart -t 10 <container_name> # Container will restart after 10 seconds

for only just stop container:
docker-compose stop <container_name>
docker-compose stop -t 10 <container_name> # Container will restart after 10

and final word is for those who want make changes without downtime, you can build new image and make changes without any stop start with this command but it will build all Dockerfile in docker-compose.yml file:
docker-compose up -d --build