From 47c06951faf90fb3aae43c9c101211e33733b04a Mon Sep 17 00:00:00 2001 From: Robin Alexander Date: Wed, 27 May 2026 18:37:13 +0200 Subject: [PATCH 1/4] Align timezone with docker environment examples --- .examples/podman/db.env | 4 ++-- .examples/podman/lb.env | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.examples/podman/db.env b/.examples/podman/db.env index 33dd1d1..143a02d 100644 --- a/.examples/podman/db.env +++ b/.examples/podman/db.env @@ -1,4 +1,4 @@ MYSQL_ROOT_PASSWORD=db_root_pwd -TZ=Europe/Helsinki +TZ=Europe/Zurich PUID=1000 -PGID=1000 \ No newline at end of file +PGID=1000 diff --git a/.examples/podman/lb.env b/.examples/podman/lb.env index 47cef0f..070dc7a 100644 --- a/.examples/podman/lb.env +++ b/.examples/podman/lb.env @@ -6,6 +6,6 @@ LB_DATABASE_HOSTSPEC=librebooking-db LB_LOGGING_FOLDER=/var/log/librebooking LB_LOGGING_LEVEL=DEBUG LB_LOGGING_SQL=false -LB_DEFAULT_TIMEZONE=Europe/Helsinki +LB_DEFAULT_TIMEZONE=Europe/Zurich LB_UPLOADS_IMAGE_UPLOAD_URL=Web/uploads/images LB_UPLOADS_RESERVATION_ATTACHMENT_PATH=Web/uploads/reservation From e3342d36ac5eb59eaa25170c2850519b2a23390f Mon Sep 17 00:00:00 2001 From: Robin Alexander Date: Wed, 27 May 2026 18:38:09 +0200 Subject: [PATCH 2/4] Rewrite the systemd section, using the kube quadlet --- .examples/podman/README.md | 158 +++++++---------------------- .examples/podman/librebooking.kube | 8 ++ 2 files changed, 45 insertions(+), 121 deletions(-) create mode 100644 .examples/podman/librebooking.kube diff --git a/.examples/podman/README.md b/.examples/podman/README.md index d81fe3a..5efe576 100644 --- a/.examples/podman/README.md +++ b/.examples/podman/README.md @@ -18,7 +18,7 @@ Create a pod podman pod create --publish 8080:8080 librebooking ``` -Add the containers to the pod +Add the database and librebooking containers to the pod ```sh podman container create \ @@ -26,7 +26,7 @@ podman container create \ --replace \ --pod librebooking \ --volume librebooking-db_conf:/config:U \ - --env-file db.env \ + --env-file $(pwd)/db.env \ docker.io/linuxserver/mariadb:10.6.13 podman container create \ @@ -36,21 +36,25 @@ podman container create \ --volume librebooking-app_conf:/config:U \ --volume librebooking-app_img:/var/www/html/Web/uploads/images:U \ --volume librebooking-app_res:/var/www/html/Web/uploads/reservation:U \ - --env-file lb.env \ + --env-file $(pwd)/lb.env \ docker.io/librebooking/librebooking:develop +``` + +If desired, add the cron container to the pod +```sh podman container create \ --name librebooking-cron \ --replace \ --pod librebooking \ --volumes-from librebooking-app \ - --volume ./crontab:/config/lb-jobs-cron:U \ - --env-file lb.env \ + --volume $(pwd)/crontab:/config/lb-jobs-cron:U \ + --env-file $(pwd)/lb.env \ docker.io/librebooking/librebooking:develop \ supercronic /config/lb-jobs-cron ``` -Start the application +Start the application and check it works as expected ```sh podman pod start librebooking @@ -68,9 +72,10 @@ This setup is equivalent to the previous one, except it uses the `podman kube play` command. From the previous example, generate the pod file + ```sh podman kube generate librebooking --filename librebooking.yml -``` +``` Start the application @@ -84,154 +89,65 @@ Stop the application podman kube down librebooking.yml ``` -## Using systemd (production) +## Using systemd -This setup is meant for accessing the application for production purposes. -[Automatic updates](https://docs.podman.io/en/latest/markdown/podman-auto-update.1.html) -for container images are not enabled in this example. Try it also, it's handy. +This setup is equivalent to the previous one, except it uses the +`systemd` infrastructure to run the application. -## Create network file +Create the quadlet drop-in directory ```sh -cat >> ~/.config/containers/systemd/librebooking.network<> ~/.config/containers/systemd/mariadb-lb.volume<> ~/.config/containers/systemd/mariadb-lb.container<> ~/.config/containers/systemd/lb-images.volume<> ~/.config/containers/systemd/lb-reservation.volume<> ~/.config/containers/systemd/lb.container<:8080. - -*Note: I tested the config on Fedora 43.* diff --git a/.examples/podman/librebooking.kube b/.examples/podman/librebooking.kube new file mode 100644 index 0000000..1f38c2d --- /dev/null +++ b/.examples/podman/librebooking.kube @@ -0,0 +1,8 @@ +[Unit] +Description=Librebooking, an open-source resource scheduling solution + +[Kube] +Yaml=./librebooking.yml + +[Install] +WantedBy=default.target From 65215f9b110efbd7656894fc6fe2601f6f6a6a33 Mon Sep 17 00:00:00 2001 From: Robin Alexander Date: Wed, 27 May 2026 18:43:09 +0200 Subject: [PATCH 3/4] No need to remove the pod in the systemd section --- .examples/podman/README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.examples/podman/README.md b/.examples/podman/README.md index 5efe576..1cf8fbb 100644 --- a/.examples/podman/README.md +++ b/.examples/podman/README.md @@ -132,12 +132,6 @@ Stop the librebooking systemd service systemctl --user stop librebooking.service ``` -Remove the pod, if it exists - -```sh -podman pod rm librebooking -``` - ### Enable autostart at boot Enable lingering for your user From 86c1e3d58959fe19209b6b57c31494359941e1ec Mon Sep 17 00:00:00 2001 From: Robin Alexander Date: Thu, 28 May 2026 10:49:06 +0200 Subject: [PATCH 4/4] Handle the case where command `podman quadlet install` is available --- .examples/podman/README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.examples/podman/README.md b/.examples/podman/README.md index 1cf8fbb..1881224 100644 --- a/.examples/podman/README.md +++ b/.examples/podman/README.md @@ -69,7 +69,7 @@ podman pod stop librebooking ## Using a pod file This setup is equivalent to the previous one, except it uses the -`podman kube play` command. +`podman kube play` command to run the pod. From the previous example, generate the pod file @@ -92,18 +92,15 @@ podman kube down librebooking.yml ## Using systemd This setup is equivalent to the previous one, except it uses the -`systemd` infrastructure to run the application. +`systemd` infrastructure to run the pod. -Create the quadlet drop-in directory +Install the `librebooking.kube` quadlet ```sh -mkdir --parents $HOME/.config/containers/systemd -``` - -Copy the kube quadlet file inside your drop-in directory - -```sh -cp librebooking.kube $HOME/.config/containers/systemd/ +if [ ! $(podman quadlet install librebooking.kube >/dev/null 2>&1) ]; then + mkdir --parents $HOME/.config/containers/systemd + cp librebooking.kube $HOME/.config/containers/systemd/ +fi ``` From the previous example, generate the pod file inside the drop-in directory