- ex16: lokale Registry + VisitCounter pushen - ex17: vollständiger Update-Zyklus (edit → build → push → restart) - ex18: VisitCounter mit Quadlets deployen - ex19: Container schrittweise härten (read-only, cap-drop, no-new-priv) - alle commands.sh umbenannt in commands.txt, Shebang entfernt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
1,010 B
Text
31 lines
1,010 B
Text
# Exercise 18 — Deploy VisitCounter via Quadlets
|
|
|
|
# Create the Quadlet directory
|
|
mkdir -p ~/.config/containers/systemd/
|
|
|
|
# Copy all Quadlet unit files
|
|
cp listings/visitcounter/quadlets/* ~/.config/containers/systemd/
|
|
|
|
# Reload systemd to pick up the new units
|
|
systemctl --user daemon-reload
|
|
|
|
# Check that units were generated
|
|
systemctl --user list-unit-files | grep visitcounter
|
|
# → visitcounter-app.service generated
|
|
# → visitcounter-db.service generated
|
|
# → visitcounter-proxy.service generated
|
|
|
|
# Start only the proxy — systemd resolves After= dependencies automatically
|
|
systemctl --user start visitcounter-proxy.service
|
|
|
|
# Verify all three services are running
|
|
systemctl --user status visitcounter-db.service
|
|
systemctl --user status visitcounter-app.service
|
|
systemctl --user status visitcounter-proxy.service
|
|
|
|
# Test
|
|
curl localhost:8080
|
|
|
|
# Bonus: kill the app container and watch systemd restart it
|
|
podman stop systemd-visitcounter-app
|
|
systemctl --user status visitcounter-app.service
|