added docker compose sysext

main
Thomas Hintz 1 month ago
parent e6cdf21b93
commit 0052d6624a

@ -11,6 +11,20 @@ systemd:
- name: thintz-com.service
enabled: true
contents_local: thintz-com/thintz-com.service
### docker-compose sysext
### https://flatcar.github.io/sysext-bakery/docker_compose/
- name: systemd-sysupdate.timer
enabled: true
- name: systemd-sysupdate.service
dropins:
- name: docker-compose.conf
contents: |
[Service]
ExecStartPre=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/docker-compose.raw > /tmp/docker-compose"
ExecStartPre=/usr/lib/systemd/systemd-sysupdate -C docker-compose update
ExecStartPost=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/docker-compose.raw > /tmp/docker-compose-new"
ExecStartPost=/usr/bin/sh -c "if ! cmp --silent /tmp/docker-compose /tmp/docker-compose-new; then touch /run/reboot-required; fi"
storage:
files:
- path: /var/lb/caddy/Caddyfile
@ -19,3 +33,19 @@ storage:
- path: /var/thintz-com/caddy/Caddyfile
contents:
local: thintz-com/Caddyfile
### docker-compose sysext
### https://flatcar.github.io/sysext-bakery/docker_compose/
- path: /opt/extensions/docker-compose/docker-compose-2.34.0-x86-64.raw
mode: 0644
contents:
source: https://extensions.flatcar.org/extensions/docker-compose-2.34.0-x86-64.raw
- path: /etc/sysupdate.docker-compose.d/docker-compose.conf
contents:
source: https://extensions.flatcar.org/extensions/docker-compose.conf
- path: /etc/sysupdate.d/noop.conf
contents:
source: https://extensions.flatcar.org/extensions/noop.conf
links:
- target: /opt/extensions/docker-compose/docker-compose-2.34.0-x86-64.raw
path: /etc/extensions/docker-compose.raw
hard: false

@ -1 +1 @@
{"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"}]}}
{"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"}},{"path":"/opt/extensions/docker-compose/docker-compose-2.34.0-x86-64.raw","contents":{"source":"https://extensions.flatcar.org/extensions/docker-compose-2.34.0-x86-64.raw"},"mode":420},{"path":"/etc/sysupdate.docker-compose.d/docker-compose.conf","contents":{"source":"https://extensions.flatcar.org/extensions/docker-compose.conf"}},{"path":"/etc/sysupdate.d/noop.conf","contents":{"source":"https://extensions.flatcar.org/extensions/noop.conf"}}],"links":[{"path":"/etc/extensions/docker-compose.raw","hard":false,"target":"/opt/extensions/docker-compose/docker-compose-2.34.0-x86-64.raw"}]},"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\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"},{"enabled":true,"name":"systemd-sysupdate.timer"},{"dropins":[{"contents":"[Service]\nExecStartPre=/usr/bin/sh -c \"readlink --canonicalize /etc/extensions/docker-compose.raw \u003e /tmp/docker-compose\"\nExecStartPre=/usr/lib/systemd/systemd-sysupdate -C docker-compose update\nExecStartPost=/usr/bin/sh -c \"readlink --canonicalize /etc/extensions/docker-compose.raw \u003e /tmp/docker-compose-new\"\nExecStartPost=/usr/bin/sh -c \"if ! cmp --silent /tmp/docker-compose /tmp/docker-compose-new; then touch /run/reboot-required; fi\"\n","name":"docker-compose.conf"}],"name":"systemd-sysupdate.service"}]}}

Loading…
Cancel
Save