Add a unit file for services
This commit is contained in:
parent
01f6a2e562
commit
ce544a933c
1 changed files with 21 additions and 0 deletions
21
unit-files/s@.service
Normal file
21
unit-files/s@.service
Normal 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
|
Loading…
Reference in a new issue