Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fabiosussetto/3397589c7950c49005a4e3dae3e2c288 to your computer and use it in GitHub Desktop.
Save fabiosussetto/3397589c7950c49005a4e3dae3e2c288 to your computer and use it in GitHub Desktop.
set -x
set -e
PREVIOUS_CONTAINER=$(docker ps --format "table {{.ID}} {{.Names}} {{.CreatedAt}}" | grep web | awk -F " " '{print $1}')
docker-compose up -d --no-deps --scale web=2 --no-recreate web
sleep 30
docker kill -s SIGTERM $PREVIOUS_CONTAINER
sleep 1
docker rm -f $PREVIOUS_CONTAINER
docker-compose up -d --no-deps --scale web=1 --no-recreate web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment