From 9b19871f1ae29912a07c9a8f29e48acad53095ee Mon Sep 17 00:00:00 2001 From: erseco Date: Tue, 7 Jul 2026 23:46:03 +0100 Subject: [PATCH 1/2] Fix Moodle 5.1+ CI container boot: drop moodlehtml volume, log on timeout The Moodle 5.1.x integration leg (added in #62) consistently timed out on container boot ('Moodle did not become ready in time'), never running any tests, while 4.5.5/5.0.1 boot fine. Root cause: since Moodle 5.1 the web root moved to /var/www/html/public and the erseco/alpine-moodle entrypoint now runs 'composer install' at startup, making first boot much heavier. Combined with the empty moodlehtml named volume mounted at /var/www/html, Docker must copy that now-larger tree (public/ + composer vendor/) into the volume on first boot before the app is usable, exceeding even the 10-minute readiness window. - Drop the moodlehtml:/var/www/html volume. A CI container runs once (no restart), so persisting the code tree across restarts gives no benefit and the image is self-contained; removing it eliminates the slow first-boot image->volume copy. moodledata (uploads/sessions) is kept, so a single CI run's correctness is unchanged. - Dump the last 80 lines of the moodle container log on readiness timeout so future boot failures are diagnosable instead of opaque. Closes #72. --- Makefile | 3 ++- docker-compose.yml | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 738cb14..5967626 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,8 @@ upd: check-docker ensure-env sleep 5; \ done; \ if [ $$ready -ne 1 ]; then \ - echo "Moodle did not become ready in time."; \ + echo "Moodle did not become ready in time. Recent container logs:"; \ + docker compose logs --tail=80 moodle || true; \ exit 1; \ fi @echo "Grace period: the login page can respond before Moodle's own"; \ diff --git a/docker-compose.yml b/docker-compose.yml index 6e6ba01..fc5c2d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -69,11 +69,9 @@ services: - 80:8080 volumes: - moodledata:/var/www/moodledata - - moodlehtml:/var/www/html depends_on: - postgres volumes: postgres: null moodledata: null - moodlehtml: null From 6a7d9d81c399a8b1d9c3517cf8387dae1aa7e5e8 Mon Sep 17 00:00:00 2001 From: erseco Date: Wed, 8 Jul 2026 00:12:59 +0100 Subject: [PATCH 2/2] Drop the moodledata volume too: CI containers are ephemeral A CI integration container is created, tested, and destroyed in a single run, so no named volume is needed for the Moodle data directory any more than for the code tree. The image manages /var/www/moodledata on its own writable layer within the run. Removing it leaves the moodle service volume-less, so nothing is persisted across the (nonexistent) restarts. Note: this does not by itself fix the Moodle 5.1 boot failure, which is a moosh-vs-5.1 issue in the erseco/alpine-moodle image (fixed separately); these are ephemeral-CI cleanups plus the on-timeout container-log dump that made that root cause diagnosable. --- docker-compose.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fc5c2d5..b253101 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -67,11 +67,8 @@ services: ports: - 80:8080 - volumes: - - moodledata:/var/www/moodledata depends_on: - postgres volumes: postgres: null - moodledata: null