Add a unit file for services

This commit is contained in:
pierreozoux 2016-02-11 10:34:14 +00:00
parent 01f6a2e562
commit ce544a933c

21
unit-files/s@.service Normal file
View file

@ -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