Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

docker-compose restart always

; To make a container restart automatically, add this to docker-compose.yml under your service name:
restart: always


; example docker-compose.yml:
services:
  website:
    image: hello-world:latest
    restart: always
    
    
; Tip: You MUST use spaces in the .yml file to indent commands, not tabs else you'll get an YAML error.
Comment

docker compose restart force recreate

docker-compose -f './traefik-with-oauth-docker-compose.yaml' up -d --build --force-recreate
Comment

docker-compose restart one container

It is very simple: Use the command:

docker-compose restart worker
You can set the time to wait for stop before killing the container (in seconds)

docker-compose restart -t 30 worker
Note that this will restart the container but without rebuilding it. If you want to apply your changes and then restart, take a look at the other answers.
Comment

PREVIOUS NEXT
Code Example
Shell :: run google chrome from terminal 
Shell :: vim frozen 
Shell :: how to delete a commit in git remotely 
Shell :: install bpytop 
Shell :: adonis migration run 
Shell :: check mint version 
Shell :: how to resize the window of a virtualbox machine ubuntu 
Shell :: windows show proxy settings 
Shell :: how to copy directory to a ssh server 
Shell :: Error: The following directories are not writable by your user: /usr/local/lib/pkgconfig 
Shell :: bash count duplicate lines in a file 
Shell :: amazon linux install ssm agent 
Shell :: bash cut first column 
Shell :: error running pod install 
Shell :: how to restart network manager in kali 
Shell :: centos copy files ssh 
Shell :: install deb linux ubuntu uninstall 
Shell :: terminal matrix effect 
Shell :: set alias in powershell 
Shell :: tmu rename tab 
Shell :: get element by index bash 
Shell :: nuxt install 
Shell :: shell script in jenkins pipeline 
Shell :: duplicate line intellij mac 
Shell :: bash cd or make dir if not exists 
Shell :: setup git in ubuntu 
Shell :: install virtualbox ubuntu 
Shell :: change default shell fedora 
Shell :: kali find devices on network 
Shell :: apt-get install certbot 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =