diff --git a/caddy-webserver.service b/caddy-webserver.service new file mode 100644 index 0000000..f4c118b --- /dev/null +++ b/caddy-webserver.service @@ -0,0 +1,24 @@ +[Unit] +Description=Caddy webserver +After=network-online.target +Wants=network-online.target + +[Service] +Type=forking +User=caddy +Group=caddy +ExecStartPre=/usr/bin/caddy validate --config /srv/www/Caddyfile +ExecStart=/usr/bin/caddy start --config /srv/www/Caddyfile +ExecReload=/usr/bin/caddy reload --config /srv/www/Caddyfile +ExecStop=/usr/bin/caddy stop +TimeoutStopSec=5s +LimitNOFILE=1048576 +LimitNPROC=512 +PrivateTmp=true +ProtectHome=full +ProtectSystem=full +AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +#RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target