You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
671 B
INI

[Unit]
Description=Caddy Load Balancer
After=docker-network.service
Requires=docker.service
Requires=docker-network.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill lb
ExecStartPre=-/usr/bin/docker rm lb
ExecStartPre=/usr/bin/docker pull docker.io/caddy:2
ExecStart=/usr/bin/docker run --name lb --log-driver=journald --net nassella -p 8081:443 -p 8080:80 -v /var/lb/caddy:/etc/caddy docker.io/caddy:2
# ExecStartPost=/usr/bin/etcdctl set /domains/example.com/%H:%i running
ExecStop=/usr/bin/docker stop lb
# ExecStopPost=/usr/bin/etcdctl rm /domains/example.com/10.10.10.123:8081
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target