2015-01-15 17:17:26 +00:00
|
|
|
[Unit]
|
|
|
|
Description=%p-%i
|
|
|
|
|
|
|
|
# Requirements
|
|
|
|
Requires=docker.service
|
2015-02-18 13:53:43 +00:00
|
|
|
Requires=discovery@%i.service
|
2015-01-15 17:17:26 +00:00
|
|
|
Requires=backup@%i.timer
|
|
|
|
|
|
|
|
# Dependency ordering
|
|
|
|
After=docker.service
|
2015-02-18 13:53:43 +00:00
|
|
|
Before=discovery@%i.service
|
2015-01-15 17:17:26 +00:00
|
|
|
Before=backup@%i.timer
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Restart=always
|
2015-02-18 13:53:28 +00:00
|
|
|
RestartSec=10
|
|
|
|
TimeoutStartSec=60
|
|
|
|
TimeoutStopSec=15
|
2015-01-15 17:17:26 +00:00
|
|
|
Type=notify
|
|
|
|
NotifyAccess=all
|
|
|
|
EnvironmentFile=/data/domains/%i/.env
|
|
|
|
Environment=URL=%i
|
|
|
|
ExecStartPre=/usr/bin/docker run --rm -v /opt/bin:/opt/bin ibuildthecloud/systemd-docker
|
|
|
|
ExecStartPre=-/usr/bin/docker kill %i
|
|
|
|
ExecStartPre=-/usr/bin/docker rm %i
|
|
|
|
ExecStartPre=/bin/cp /data/domains/%i/TLS/%i.pem /data/runtime/haproxy/approved-certs/%i.pem
|
|
|
|
ExecStart=/bin/bash -euxc ' \
|
|
|
|
/opt/bin/systemd-docker --env run \
|
|
|
|
--rm \
|
|
|
|
--name %i \
|
2015-02-16 16:33:03 +00:00
|
|
|
-v /data/runtime/domains/%i/log/apache2:/var/log/apache2 \
|
2015-01-15 17:17:26 +00:00
|
|
|
${DOCKER_ARGUMENTS} \
|
2015-03-29 14:09:13 +00:00
|
|
|
indiepaas/${APPLICATION}'
|
2015-02-18 13:53:43 +00:00
|
|
|
ExecReload=/usr/bin/docker restart %i
|
2015-01-15 17:17:26 +00:00
|
|
|
ExecStop=/usr/bin/docker stop %i
|
|
|
|
|