35 lines
1.2 KiB
Text
35 lines
1.2 KiB
Text
# Exercise 18 — Deploy VisitCounter via Quadlets
|
|
|
|
# nginx config an Ort und Stelle bringen (wird vom Proxy-Quadlet als Bind Mount erwartet)
|
|
mkdir -p ~/visitcounter/nginx
|
|
cp listings/visitcounter/nginx/default.conf ~/visitcounter/nginx/
|
|
|
|
# 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
|