Skip to content

Switch to PHP 8.3-FPM + nginx single-container image - #13

Open
jwarnier wants to merge 2 commits into
chamilo:masterfrom
jwarnier:takeover-php83-upstream
Open

Switch to PHP 8.3-FPM + nginx single-container image#13
jwarnier wants to merge 2 commits into
chamilo:masterfrom
jwarnier:takeover-php83-upstream

Conversation

@jwarnier

@jwarnier jwarnier commented Sep 1, 2026

Copy link
Copy Markdown

The current image is PHP 5 on ubuntu:14.04 pinned to v1.10.0-alpha — it cannot run the current (Symfony 7 / PHP 8) LMS, SETUP.md references a docker-compose.yml that isn't in the repo, and the Apache vhost points at a Chamilo 2 path that doesn't match the Dockerfile. This PR switches the repo to a working, modern image.

What

A single container running PHP 8.3-FPM + nginx, serving the LMS over HTTP on :80 (nginx → FPM on 127.0.0.1:9000). The LMS source is fetched at build time at a pinned ref (CHAMILO_LMS_REF build arg), not vendored — the repo stays slim and the image reproducible.

Files

  • Dockerfile — PHP 8.3-FPM base, fetches LMS at CHAMILO_LMS_REF, installs Composer deps + nginx, sets memory_limit=-1 (Symfony assets:install OOMs at the 128 M default), drops git (all deps ship zip dists).
  • nginx.conf — Symfony front controller → FPM; statics direct; dotfiles denied.
  • entrypoint.sh — starts php-fpm then exec nginx (PID 1).
  • docker-compose.ymlchamilo + MariaDB 11 + Redis 7, with DATABASE_* env (the names the LMS reads — not DB_*).
  • README.md / SETUP.md — rewritten to match the real workflow.
  • AGENTS.md — agent playbook: build/run/verify workflow + gotchas (memory_limit OOM, nested-.git bloat, DATABASE_* vs DB_*, FPM port, no-TLS, slim-repo rule).
  • 000-default.conf — removed (obsolete Apache vhost).

Verified

  • Image builds: 1.35 GB, 322/322 Composer packages, assets:install succeeds, nginx installed.
  • Runtime: FPM on :9000, nginx valid, / returns 302 (Symfony installer redirect) — proves nginx → FPM → PHP → Symfony is wired.

Notes

  • Pinned ref is a chamilo/chamilo-lms master SHA (newer than the latest tag) to reproduce the current tree. Bump CHAMILO_LMS_REF to a release tag for a public release.
  • TLS is terminated in front of this container (it speaks plain HTTP).

Replace the dead PHP 5 / ubuntu 14.04 image (which cannot run the current
Symfony 7 / PHP 8 LMS) with a single-container image:

- PHP 8.3-FPM (www pool on 127.0.0.1:9000)
- nginx (HTTP :80) serving statics + proxying .php to FPM
- LMS source fetched at build time at a pinned ref (CHAMILO_LMS_REF),
  not vendored — keeps this repo slim and the image reproducible
- memory_limit=-1 so Symfony's assets:install doesn't OOM
- git dropped (all Composer deps ship zip dists)

Compose (from our local setup): chamilo + MariaDB 11 + Redis 7, with
DATABASE_* env names the LMS actually reads.

Adds docker-compose.yml, entrypoint.sh, nginx.conf; removes the obsolete
Apache vhost (000-default.conf); rewrites README/SETUP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant