From a19b59a00e8b702dd83619b90c4c0cfc9ec1b8e2 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Sun, 27 Sep 2020 14:06:24 -0400 Subject: [PATCH] service file --- scripts/services/Mistborn-mattermost.service | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scripts/services/Mistborn-mattermost.service diff --git a/scripts/services/Mistborn-mattermost.service b/scripts/services/Mistborn-mattermost.service new file mode 100644 index 0000000..f27606f --- /dev/null +++ b/scripts/services/Mistborn-mattermost.service @@ -0,0 +1,21 @@ +[Unit] +Description=Mistborn Mattermost Service +Requires=Mistborn-base.service +After=Mistborn-base.service + +[Service] +Restart=always +User=root +Group=docker +PermissionsStartOnly=true +# Shutdown container (if running) when unit is stopped +ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/mattermost.yml down + +# Start container when unit is started +ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/mattermost.yml up --build +# Stop container when unit is stopped +ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/mattermost.yml down +# Post stop + +[Install] +WantedBy=multi-user.target