compose-website/unit-files/mysql@.service

28 lines
633 B
SYSTEMD
Raw Normal View History

2014-10-28 15:10:30 +00:00
[Unit]
Description=%p-%i
2014-10-28 16:24:00 +00:00
# Requirements
2014-10-28 15:10:30 +00:00
Requires=docker.service
Requires=%p-importer@%i.service
2014-10-28 16:24:00 +00:00
# Dependency ordering
After=docker.service
After=%p-importer@%i.service
2014-12-03 17:08:01 +00:00
Before=backup@%i.timer
2014-10-28 16:24:00 +00:00
2014-10-28 15:10:30 +00:00
[Service]
Restart=always
2014-10-28 16:24:00 +00:00
ExecStartPre=-/usr/bin/docker kill %p-%i
2014-10-28 15:10:30 +00:00
ExecStartPre=-/usr/bin/docker rm %p-%i
2014-10-28 16:24:00 +00:00
ExecStart=/usr/bin/docker run \
--name %p-%i \
2014-11-04 19:25:39 +00:00
-v /data/runtime/domains/%i/%p/db_files:/var/lib/mysql \
2014-12-03 17:09:41 +00:00
-e STARTUP_SQL="/data/domains/%i/%p/dump.sql" \
2014-11-04 18:07:18 +00:00
--env-file /data/domains/%i/%p/.env \
2014-10-28 16:24:00 +00:00
indiehosters/mysql
2014-10-28 15:10:30 +00:00
ExecReload=/usr/bin/docker restart %p-%i
2014-10-28 16:24:00 +00:00
ExecStop=/usr/bin/docker stop %p-%i
2014-10-28 15:10:30 +00:00
[Install]
WantedBy=multi-user.target