diff --git a/.examples/podman/README.md b/.examples/podman/README.md index d81fe3a..1881224 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 @@ -65,12 +69,13 @@ 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 + ```sh podman kube generate librebooking --filename librebooking.yml -``` +``` Start the application @@ -84,154 +89,56 @@ Stop the application podman kube down librebooking.yml ``` -## Using systemd (production) - -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. - -## Create network file - -```sh -cat >> ~/.config/containers/systemd/librebooking.network<> ~/.config/containers/systemd/mariadb-lb.volume<> ~/.config/containers/systemd/mariadb-lb.container</dev/null 2>&1) ]; then + mkdir --parents $HOME/.config/containers/systemd + cp librebooking.kube $HOME/.config/containers/systemd/ +fi ``` -## Create Images Volume +From the previous example, generate the pod file inside the drop-in directory ```sh -cat >> ~/.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/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 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