mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-13 00:26:31 +00:00
Kill and remove containers gracefully without error when zero are running
This commit is contained in:
@@ -8,6 +8,10 @@ fi
|
|||||||
|
|
||||||
docker build -t $1 -f rails-prod-Dockerfile .
|
docker build -t $1 -f rails-prod-Dockerfile .
|
||||||
|
|
||||||
docker kill $(docker ps -q)
|
#Kill and remove containers gracefully without error if none are running
|
||||||
|
docker ps -a | grep "Exit" | awk '{print $1}' | while read -r id ; do
|
||||||
|
docker kill $id
|
||||||
|
docker rm $id
|
||||||
|
done
|
||||||
|
|
||||||
docker run -h $HOSTNAME --name $1 -d --restart=always --env-file $WRESTLINGDEV_ENV_FILE -v /srv/docker/apache2/logs:/var/log/apache2 -v /etc/localtime:/etc/localtime -p 80:80 -p 443:443 $1
|
docker run -h $HOSTNAME --name $1 -d --restart=always --env-file $WRESTLINGDEV_ENV_FILE -v /srv/docker/apache2/logs:/var/log/apache2 -v /etc/localtime:/etc/localtime -p 80:80 -p 443:443 $1
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ fi
|
|||||||
|
|
||||||
docker build -t $1 -f rails-prod-Dockerfile .
|
docker build -t $1 -f rails-prod-Dockerfile .
|
||||||
|
|
||||||
docker kill $(docker ps -q)
|
#Kill and remove containers gracefully without error if none are running
|
||||||
|
docker ps -a | grep "Exit" | awk '{print $1}' | while read -r id ; do
|
||||||
|
docker kill $id
|
||||||
|
docker rm $id
|
||||||
|
done
|
||||||
|
|
||||||
docker run -h $HOSTNAME --name $1 -d --restart=always --env-file $WRESTLINGDEV_ENV_FILE -v /etc/localtime:/etc/localtime $1 bundle exec rake jobs:work RAILS_ENV=production
|
docker run -h $HOSTNAME --name $1 -d --restart=always --env-file $WRESTLINGDEV_ENV_FILE -v /etc/localtime:/etc/localtime $1 bundle exec rake jobs:work RAILS_ENV=production
|
||||||
Reference in New Issue
Block a user