38 lines
1.3 KiB
Django/Jinja
38 lines
1.3 KiB
Django/Jinja
# cat /etc/systemd/system/graphite-web.service
|
|
# This is a systemd file to run this docker container under systemd.
|
|
# To make this work:
|
|
# * place this file in /etc/systemd/system and run the commands:
|
|
#
|
|
# systemctl daemon-reload
|
|
# systemctl enable graphite-web
|
|
# systemctl start graphite-web
|
|
#
|
|
[Unit]
|
|
Description=graphite-web
|
|
Requires=docker.service
|
|
After=docker.service
|
|
|
|
[Service]
|
|
Type=simple
|
|
TimeoutStartSec=5m
|
|
# systemd syntax '=-' ignore errors from return codes.
|
|
ExecStartPre=-/usr/bin/docker kill "graphite-web"
|
|
ExecStartPre=-/usr/bin/docker rm "graphite-web"
|
|
ExecStartPre=-/usr/bin/mkdir -p {{ persistent_carbon_data_path }}
|
|
ExecStartPre=-/usr/bin/chmod 777 {{ persistent_carbon_data_path }}
|
|
|
|
ExecStart=/usr/bin/docker run --name graphite-web -p {{ docker_graphite_port }}:80 -v {{ persistent_carbon_data_path }}:/var/lib/carbon/whisper {{ graphite_web_docker_image }}
|
|
|
|
ExecReload=-/usr/bin/docker stop "graphite-web"
|
|
ExecReload=-/usr/bin/docker rm "graphite-web"
|
|
ExecReload=/usr/bin/docker run --name graphite-web -p {{ docker_graphite_port }}:80 -v {{ persistent_carbon_data_path }}:/var/lib/carbon/whisper {{ graphite_web_docker_image }}
|
|
|
|
ExecStop=-/usr/bin/docker stop "graphite-web"
|
|
ExecStop=-/usr/bin/docker rm "graphite-web"
|
|
|
|
Restart=always
|
|
RestartSec=30
|
|
|
|
[Install]
|
|
WantedBy=default.target
|