From ce544a933c7f649e72467495b586e0136de7fb21 Mon Sep 17 00:00:00 2001 From: pierreozoux Date: Thu, 11 Feb 2016 10:34:14 +0000 Subject: [PATCH] Add a unit file for services --- unit-files/s@.service | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 unit-files/s@.service diff --git a/unit-files/s@.service b/unit-files/s@.service new file mode 100644 index 0000000..987d484 --- /dev/null +++ b/unit-files/s@.service @@ -0,0 +1,21 @@ +[Unit] +Description=%p-%i + +# Requirements +Requires=docker.service + +# Dependency ordering +After=docker.service + +[Service] +Restart=always +RestartSec=10 +TimeoutStartSec=60 +TimeoutStopSec=15 +WorkingDirectory=/system/%i/ +ExecStartPre=-/opt/bin/docker-compose rm -f +ExecStart=/bin/bash -euxc "/opt/bin/docker-compose up" +ExecStop=/opt/bin/docker-compose stop + +[Install] +WantedBy=multi-user.target