handle ungraceful restarts

This commit is contained in:
Steven Foerster
2021-05-04 16:29:22 -04:00
parent 97d25bbce4
commit 75da49eeab
2 changed files with 6 additions and 2 deletions
+5
View File
@@ -13,6 +13,11 @@ Group=docker
PermissionsStartOnly=true
# Shutdown container (if running) when unit is stopped
EnvironmentFile=/opt/mistborn/.env
# stop all containers joined to mistborn_default network
ExecStartPre=-/usr/bin/bash -c "docker container stop $(docker network inspect mistborn_default | grep Name | tail -n +2 | cut -d':' -f2 | tr -d ',\"') 2>/dev/null"
# bring down the base service
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml down
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml build