Permalink
Browse files

Add init files and commands for systemd

  • Loading branch information...
CristianCantoro committed May 13, 2017
1 parent a71330e commit 7dcd96343739c197e9338736655a06eba5874023
Showing with 38 additions and 0 deletions.
  1. +8 −0 Makefile
  2. +30 −0 init/caddy.systemd
View
@@ -11,6 +11,14 @@ configfile:
--head head.Caddyfile
@echo '-> success'
install: install-systemd
install-systemd:
cp init/caddy.systemd /etc/systemd/system/
install-upstart:
cp init/caddy.upstart /etc/init/
mirror:
docker run --rm \
--name wikimirror \
View
@@ -0,0 +1,30 @@
# systemd: Start containers automatically
# https://docs.docker.com/engine/admin/host_integration/
#
# Runninng Docker containers as systemd services
# https://goldmann.pl/blog/
# 2014/07/30/running-docker-containers-as-systemd-services/
#
# systemd-docker
# https://github.com/ibuildthecloud/systemd-docker
[Unit]
Description=Caddy web server
After=docker.service
Requires=docker.service
[Service]
User=www-data
Restart=on-failure
RestartSec=10
Type=notify
NotifyAccess=all
TimeoutStartSec=120
TimeoutStopSec=15
ExecStart=/opt/bin/systemd-docker run --rm --name %n nginx
# ExecStartPre=-/usr/bin/docker kill abiosoft/caddy
# ExecStartPre=-/usr/bin/docker rm abiosoft/caddy
# ExecStart=/usr/bin/docker run --rm --name wikimirror -p 80:80 abiosoft/caddy
# ExecStop=/usr/bin/docker stop abiosoft/caddy
[Install]
WantedBy=multi-user.target

0 comments on commit 7dcd963

Please sign in to comment.