fancier docker usage

main
Thomas Hintz 1 month ago
parent abcf3e4c9d
commit e6cdf21b93

@ -1 +1 @@
{"ignition":{"version":"3.4.0"},"storage":{"files":[{"path":"/var/lb/caddy/Caddyfile","contents":{"compression":"","source":"data:,localhost%0A%0Areverse_proxy%20thintz-com%0Alog"}},{"path":"/var/thintz-com/caddy/Caddyfile","contents":{"compression":"","source":"data:,localhost%0A%0Arespond%20%22thintz-com!%22%0Alog"}}]},"systemd":{"units":[{"contents":"[Unit]\nDescription=Caddy Load Balancer\nAfter=docker-network.service\nRequires=docker.service\nRequires=docker-network.service\n[Service]\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker rm --force lb\nExecStart=/usr/bin/docker run --name lb --pull always --log-driver=journald --net nassella -p 8081:443 -p 8080:80 -v /var/lb/caddy:/etc/caddy docker.io/caddy:2\nExecStop=/usr/bin/docker stop lb\nRestart=always\nRestartSec=5s\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"lb.service"},{"contents":"[Unit]\nDescription=Docker Network Setup\nAfter=docker.service\nRequires=docker.service\n[Service]\nTimeoutStartSec=0\nExecStart=/usr/bin/docker network create -d bridge nassella\nExecStop=-/usr/bin/docker network rm nassella\nRestart=never\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"docker-network.service"},{"contents":"[Unit]\nDescription=thintz.com static site\nAfter=docker-network.service\nRequires=docker.service\nRequires=docker-network.service\n[Service]\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker rm --force thintz-com\nExecStart=/usr/bin/docker run --name thintz-com --pull always --log-driver=journald --net nassella -p 8082:80 -p 8083:443 -v /var/thintz-com/caddy:/etc/caddy -v /var/thintz-com/site:/var/site docker.io/caddy:2\nExecStop=/usr/bin/docker stop thintz-com\nRestart=always\nRestartSec=5s\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"thintz-com.service"}]}} {"ignition":{"version":"3.4.0"},"storage":{"files":[{"path":"/var/lb/caddy/Caddyfile","contents":{"compression":"","source":"data:,localhost%0A%0Arespond%20%22lb!%22%0A%23%20reverse_proxy%20thintz-com%0Alog"}},{"path":"/var/thintz-com/caddy/Caddyfile","contents":{"compression":"","source":"data:,localhost%0A%0Arespond%20%22thintz-com!%22%0Alog"}}]},"systemd":{"units":[{"contents":"[Unit]\nDescription=Caddy Load Balancer\nAfter=docker-network.service\nRequires=docker.service\nRequires=docker-network.service\n[Service]\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker kill lb\nExecStartPre=-/usr/bin/docker rm lb\nExecStartPre=/usr/bin/docker pull docker.io/caddy:2\nExecStart=/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\n# ExecStartPost=/usr/bin/etcdctl set /domains/example.com/%H:%i running\nExecStop=/usr/bin/docker stop lb\n# ExecStopPost=/usr/bin/etcdctl rm /domains/example.com/10.10.10.123:8081\n\n# TimeoutStartSec=0\n# ExecStartPre=-/usr/bin/docker rm --force lb\n# ExecStart=/usr/bin/docker run --name lb --pull always --log-driver=journald --net nassella -p 8081:443 -p 8080:80 -v /var/lb/caddy:/etc/caddy docker.io/caddy:2\n# ExecStop=/usr/bin/docker stop lb\n\nRestart=always\nRestartSec=5s\n[Install]\nWantedBy=multi-user.target\n\n","enabled":true,"name":"lb.service"},{"contents":"[Unit]\nDescription=Docker Network Setup\nAfter=docker.service\nRequires=docker.service\n[Service]\nTimeoutStartSec=0\nExecStart=/usr/bin/docker network create -d bridge nassella\nExecStop=-/usr/bin/docker network rm nassella\nRestart=never\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"docker-network.service"},{"contents":"[Unit]\nDescription=thintz.com static site\nAfter=docker-network.service\nRequires=docker.service\nRequires=docker-network.service\n[Service]\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker rm --force thintz-com\nExecStart=/usr/bin/docker run --name thintz-com --pull always --log-driver=journald --net nassella -p 8082:80 -p 8083:443 -v /var/thintz-com/caddy:/etc/caddy -v /var/thintz-com/site:/var/site docker.io/caddy:2\nExecStop=/usr/bin/docker stop thintz-com\nRestart=always\nRestartSec=5s\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"thintz-com.service"}]}}

@ -1,4 +1,5 @@
localhost localhost
reverse_proxy thintz-com respond "lb!"
# reverse_proxy thintz-com
log log

@ -5,10 +5,16 @@ Requires=docker.service
Requires=docker-network.service Requires=docker-network.service
[Service] [Service]
TimeoutStartSec=0 TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker rm --force lb ExecStartPre=-/usr/bin/docker kill lb
ExecStart=/usr/bin/docker run --name lb --pull always --log-driver=journald --net nassella -p 8081:443 -p 8080:80 -v /var/lb/caddy:/etc/caddy docker.io/caddy:2 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 ExecStop=/usr/bin/docker stop lb
# ExecStopPost=/usr/bin/etcdctl rm /domains/example.com/10.10.10.123:8081
Restart=always Restart=always
RestartSec=5s RestartSec=5s
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

Loading…
Cancel
Save