mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
f1c1ea9905
Unlike network.target the network-online.target guarantees that the network devices are online. If you bind to 0.0.0.0, [::], [::1], and/or 127.0.0.1 only that is enough to proceed. But in case a particular IP is needed, like ${COREOS_PUBLIC_IPV4}, we require any IP assignments to have completed before Caddy's start. That is achieved by depending on systemd-networkd-wait-online.service (which is scheduled before network-online.target, then, automatically).
23 lines
663 B
Desktop File
23 lines
663 B
Desktop File
; see `man systemd.unit` for configuration details
|
|
; the man section also explains *specifiers* `%x`
|
|
|
|
[Unit]
|
|
Description=Caddy HTTP/2 web server %I
|
|
Documentation=https://caddyserver.com/docs
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
Wants=systemd-networkd-wait-online.service
|
|
|
|
[Service]
|
|
; run user and group for caddy
|
|
User=%i
|
|
Group=http
|
|
ExecStart=/usr/bin/caddy -agree=true -conf=/etc/caddy/Caddyfile
|
|
Restart=on-failure
|
|
; create a private temp folder that is not shared with other processes
|
|
PrivateTmp=true
|
|
; limit the number of file descriptors, see `man systemd.exec` for more limit settings
|
|
LimitNOFILE=8192
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|