Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
859d74a
Added podman build tasks as well as logging. Added quadlets as a Dock…
barakiva Apr 1, 2026
4b2c251
Most of quadlets now works.
barakiva Apr 1, 2026
7d0597d
Writing infra sanity tests to speed up debugging.
barakiva Apr 2, 2026
629e82f
Cron bug fixed. Added pytest and removed goss. Made scripts more robust
barakiva Apr 5, 2026
a584929
Going to the office push
barakiva Apr 14, 2026
571cf6f
Made tasks.json load shell so its conscious of docker context.
barakiva Apr 14, 2026
ad026ea
All tests pass for podman and docker
barakiva Apr 14, 2026
d7dbced
Ignored a couple of python files
barakiva Apr 14, 2026
ac0c6a0
Tests pass for docker. Cleaned up.
barakiva Apr 14, 2026
584b6e0
Tests pass for podman quadlets tasks
barakiva Apr 14, 2026
f503254
Added documentation for using podman quadlets, the equilvaent of dock…
barakiva Apr 14, 2026
4c928bb
Cleaned up unecessary pytest config
barakiva Apr 14, 2026
23cd92e
Applied linter fixes
barakiva Apr 14, 2026
5ba13a4
Update tests/test_docker_db.py
barakiva Apr 14, 2026
7713424
Update scripts/stop
barakiva Apr 14, 2026
45e3b72
Cleaned stale code. Improved python config, improved quadlets config
barakiva Apr 15, 2026
8ab9e78
cleaned up tests
barakiva Apr 15, 2026
db5f578
Extracted multi-line script into a line referenced by Dockerfile as a…
barakiva Apr 19, 2026
251b8d4
fix: fixed linting error
barakiva Apr 20, 2026
5ae4ab8
fix: ok now the linting problem is fixed for real
barakiva Apr 20, 2026
fb92eb6
fix: ok now for real for real this is fixed and linting will pass god…
barakiva Apr 20, 2026
b8486bf
Update .examples/docker/docker-compose-local.yml
colisee Apr 20, 2026
3c1a41d
Merge branch 'master' into automation-podman
colisee Apr 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .examples/docker/crontab
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Every minute
* * * * * php -f /var/www/html/Jobs/autorelease.php
* * * * * php -f /var/www/html/Jobs/sendmissedcheckin.php
* * * * * php -f /var/www/html/Jobs/sendreminders.php
* * * * * php -f /var/www/html/Jobs/sendwaitlist.php

# Every day at midnight
0 0 * * * php -f /var/www/html/Jobs/sendseriesend.php
0 0 * * * php -f /var/www/html/Jobs/sessioncleanup.php
0 0 * * * php -f /var/www/html/Jobs/deleteolddata.php
7 changes: 5 additions & 2 deletions .examples/docker/db.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
MYSQL_ROOT_PASSWORD=db_root_pwd
TZ=Europe/Zurich
PUID=1000
PGID=1000
PGID=1000
MYSQL_ROOT_PASSWORD=db_root_pwd
MYSQL_DATABASE=librebooking
MYSQL_USER=lb_user
MYSQL_PASSWORD=db_user_pwd
1 change: 1 addition & 0 deletions .examples/docker/docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- app
volumes:
- app_conf:/config
- ./crontab:/crontab:ro
Comment thread
colisee marked this conversation as resolved.
Outdated
env_file:
- lb.env

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__pycache__/
*.pyc
.mypy_cache/
.venv/
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python-envs.defaultEnvManager": "ms-python.python:poetry",
"python-envs.defaultPackageManager": "ms-python.python:poetry"
}
119 changes: 98 additions & 21 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"version": "2.0.0",
"tasks": [
// Logging
// Docker
// Logging
{
"label": "Logs: librebooking (docker)",
"command": "docker compose --file docker-compose-local.yml logs app -f",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/.examples/docker",
"env": {
"DOCKER_HOST": "unix:///run/docker.sock" // Sometimes the tasks shell doesnt inherit .bashrc DOCKER_HOST, neither the docker context
"shell": {
"executable": "bash",
"args": ["-i", "-c"]
}
},
"presentation": {
Expand All @@ -23,8 +25,9 @@
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/.examples/docker",
"env": {
"DOCKER_HOST": "unix:///run/docker.sock"
"shell": {
"executable": "bash",
"args": ["-i", "-c"]
}
},
"presentation": {
Expand All @@ -38,8 +41,9 @@
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/.examples/docker",
"env": {
"DOCKER_HOST": "unix:///run/docker.sock"
"shell": {
"executable": "bash",
"args": ["-i", "-c"]
}
},
"presentation": {
Expand All @@ -66,8 +70,9 @@
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/.examples/docker",
"env": {
"DOCKER_HOST": "unix:///run/docker.sock"
"shell": {
"executable": "bash",
"args": ["-i", "-c"]
}
},
"presentation": {
Expand All @@ -78,36 +83,108 @@
// Booting
{
"label": "Hard Restart: all (docker)",
"command": "docker compose --file docker-compose-local.yml down --remove-orphans && docker compose --file docker-compose-local.yml up -d ",
"command": "docker compose --file docker-compose-local.yml down --remove-orphans && docker compose --file docker-compose-local.yml up -d --pull always",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/.examples/docker",
"env": {
"DOCKER_HOST": "unix:///run/docker.sock"
"shell": {
"executable": "bash",
"args": ["-i", "-c"]
}
},
"type": "shell"
}
},
{
"label": "Start: all (docker)",
"command": "docker compose --file docker-compose-local.yml up -d",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/.examples/docker",
"env": {
"DOCKER_HOST": "unix:///run/docker.sock"
"shell": {
"executable": "bash",
"args": ["-i", "-c"]
}
},
"type": "shell"
}
},
{
"label": "Stop: all (docker)",
"command": "docker compose --file docker-compose-local.yml down --remove-orphans",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/.examples/docker",
"env": {
"DOCKER_HOST": "unix:///run/docker.sock"
"shell": {
"executable": "bash",
"args": ["-i", "-c"]
}
}
},
// Logging (podman)
{
"label": "Logs: librebooking (podman)",
"command": "journalctl --user -u app -f",
"type": "shell",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Logs: db (podman)",
"command": "journalctl --user -u db -f",
"type": "shell",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Logs: cron (podman)",
"command": "journalctl --user -u cron -f",
"type": "shell",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Logs:all",
"dependsOn": [
"Logs:librebooking",
"Logs:db",
"Logs:phpmyadmin"
Comment thread
barakiva marked this conversation as resolved.
Outdated
],
"presentation": {
"reveal": "always",
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "Status: all (podman)",
"command": "systemctl --user status app db librebooking-phpmyadmin",
Comment thread
barakiva marked this conversation as resolved.
Outdated
"type": "shell",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
// Booting (podman)
{
"label": "Restart: all (podman)",
"command": "${workspaceFolder}/scripts/restart",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/scripts"
}
},
{
"label": "Start: all (podman)",
"command": "${workspaceFolder}/scripts/start",
"type": "shell"
}
},
{
"label": "Stop: all (podman)",
"command": "${workspaceFolder}/scripts/stop",
"type": "shell"
},
Comment thread
barakiva marked this conversation as resolved.
]
}
28 changes: 11 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,22 @@ FROM composer:${VERSION_COMPOSER} AS comp
FROM alpine/git:${VERSION_GIT} AS upstream
ARG APP_GH_ADD_SHA=false
ARG APP_GH_REF=refs/heads/develop
ARG GIT_TREE=${APP_GH_REF##*/}
ARG GIT_TREE
ARG UPSTREAM_URL="https://github.com/librebooking/librebooking"
WORKDIR /upstream
RUN <<EORUN
set -eux
git clone ${UPSTREAM_URL} /upstream
git checkout ${GIT_TREE}
if [ "${APP_GH_ADD_SHA}" = "true" ]; then
git describe --tags --long > config/custom-version.txt
fi
rm -rf .git
EORUN
RUN set -eux; \
GIT_TREE="$(basename "${APP_GH_REF}")"; \

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARG GIT_TREE is now effectively unused because the RUN step always overwrites GIT_TREE from APP_GH_REF. Either remove the build arg or honor it (e.g., only derive from APP_GH_REF when GIT_TREE is unset) to avoid confusing/ineffective build parameters.

Suggested change
GIT_TREE="$(basename "${APP_GH_REF}")"; \
: "${GIT_TREE:=$(basename "${APP_GH_REF}")}"; \

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my side, I have no issues with the heredoc construct (RUN <<EORUN). I am using Debian-13 (trixie) with podman version 5.4.2.

Could you confirm that podman build fails in your environment? If yes, can you give us more details on your environment (linux distribution, podman version,...) ?

@barakiva barakiva Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running the unmodified Dockerfile as it exists in the upstream repo gives the following:

[2/4] STEP 8/15: set -eux
ERRO[0000] +(UNHANDLED LOGLEVEL) &imagebuilder.Step{Env:[]string{"APP_GH_ADD_SHA=false", "APP_GH_REF=refs/heads/develop", "UPSTREAM_URL=https://github.com/librebooking/librebooking", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}, Command:"set", Args:[]string{""}, Flags:[]string{}, Attrs:map[string]bool(nil), Message:"SET ", Original:"set -eux"} 
Error: building at STEP "SET ": Build error: Unknown instruction: "SET" &imagebuilder.Step{Env:[]string{"APP_GH_ADD_SHA=false", "APP_GH_REF=refs/heads/develop", "UPSTREAM_URL=https://github.com/librebooking/librebooking", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}, Command:"set", Args:[]string{""}, Flags:[]string{}, Attrs:map[string]bool(nil), Message:"SET ", Original:"set -eux"}
 *  The terminal process "/bin/bash '-c', '/home/bar/Development/Projects/Bookme/bookme/scripts/start'" failed to launch (exit code: 125). 

The Buildah repo has the following discussion here podman-container-tools/buildah#3474. Theres also a PR for adding heredoc support for RUN .

As to why its still a problem on my machine, I assume it's because im using podman 4.9.3 on Pop OS 24.04 (ubuntu distro) and Ubuntu is yet to have heredoc support as shown in HEREDOC: Not available in 1.33.5 1.33.7 1.34 on Ubuntu, Debian, etc? · Issue #5474 · containers/buildah
podman-container-tools/buildah#5474.

If the inclusion of heredoc is critical, maybe could you tell me what it's intended to achieve and I could come up with a suitable alternative?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing critical: it's just that we found heredoc easier to read and less error prone (no need to end each line with ; \.

We switched quite recently to heredoc with librebooking/docker release 3.3.0 and I am not keen on reverting back the heredoc construct...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can propose an alternative: instead of having 2 setup scripts (sys and app) we could have only one. We would call it with 1 argument that would indicate which code to execute. For instance: setup app or setup sys etc… This way, we would have in Dockerfile something like ˋRUN setup sys`.

What do you think?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikke-t , @JohnVillalovos : what is your opinion? I like Bar's PR and I'd like to put in prod, but we need to fix the heredoc issue that affects users who use an old version of podman...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can propose an alternative: instead of having 2 setup scripts (sys and app) we could have only one. We would call it with 1 argument that would indicate which code to execute. For instance: setup app or setup sys etc… This way, we would have in Dockerfile something like ˋRUN setup sys`.

What do you think?

Hey check my recent commit. I'm calling the script & passing the arguments. No need for a heredox and you get syntax highlighting. Is that satisfactory?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who does such an old issue of podman still hit? Seems the discussion is from 2023, so is it valid problem still? Apparently it's a problem if it hits you still.

OTOH, I don't mind how it's done as long as it works. It don't know if it causes useless layer rebuilds in case of nothing changes in dockerfile, or does something not get noticed if e.g. the script changes but Dockerfile doesn't. I haven't really gone so deep into looking what affects rebuilds.

git clone "${UPSTREAM_URL}" .; \
git checkout "${GIT_TREE}"; \
if [ "${APP_GH_ADD_SHA}" = "true" ]; then \
git describe --tags --long > config/custom-version.txt; \
fi; \
rm -rf .git


# Build supercronic
FROM golang:trixie AS supercronic
ADD https://github.com/aptible/supercronic.git#v0.2.44 /go/src/
WORKDIR /go/src
RUN <<EORUN
set -eux
go mod vendor
go install
EORUN
RUN go install github.com/aptible/supercronic@v0.2.44

FROM php:${VERSION_PHP}-apache
# Labels
Expand Down
Loading