Summary
docker compose up --build on a fresh clone of master fails during the composer install step inside the container because the Dockerfile base image (php:7.3-apache) is two major PHP versions behind what composer.json / composer.lock require.
Steps to reproduce
git clone https://github.com/sunnah-com/website.git
cd website
cp .env.local.sample .env.local
docker compose up --build
Observed
composer install aborts with version constraint errors. Selected output:
- yiisoft/yii2 2.0.54 requires php >=7.4.0 -> your php version (7.3.33) does not satisfy that requirement.
- symfony/var-dumper v8.0.8 requires php >=8.4 -> your php version (7.3.33) does not satisfy that requirement.
- symfony/yaml v8.0.10 requires php >=8.4 -> your php version (7.3.33) does not satisfy that requirement.
The build then fails:
failed to solve: process "/bin/sh -c composer install" did not complete successfully: exit code: 2
Root cause
Dockerfile line 1: FROM php:7.3-apache → PHP 7.3.33 in the container.
composer.json requires "php": ">=8.3.0".
composer.lock pins several dependencies (notably symfony/var-dumper, symfony/yaml, transitive deps of codeception) that require PHP >= 8.4.
The result is that the documented "Quick start" path in the README cannot succeed on master as it currently stands.
Suggested fix
Bump the base image to php:8.4-apache to match the composer.json and composer.lock constraints:
-FROM php:7.3-apache
+FROM php:8.4-apache
PHP 8.4 is the current GA release and is the minimum compatible version implied by composer.lock. No other Dockerfile changes appear necessary — the pdo, pdo_mysql, and mysqli extensions, plus Apache's rewrite module, are all still installed the same way on PHP 8.4.
I verified this locally: applying the one-line change above lets docker build complete successfully, including composer install (28.5s), and the image builds end-to-end.
I'm happy to send a PR with this change if it would help.
Summary
docker compose up --buildon a fresh clone ofmasterfails during thecomposer installstep inside the container because theDockerfilebase image (php:7.3-apache) is two major PHP versions behind whatcomposer.json/composer.lockrequire.Steps to reproduce
git clone https://github.com/sunnah-com/website.git cd website cp .env.local.sample .env.local docker compose up --buildObserved
composer installaborts with version constraint errors. Selected output:The build then fails:
Root cause
Dockerfileline 1:FROM php:7.3-apache→ PHP 7.3.33 in the container.composer.jsonrequires"php": ">=8.3.0".composer.lockpins several dependencies (notablysymfony/var-dumper,symfony/yaml, transitive deps ofcodeception) that require PHP>= 8.4.The result is that the documented "Quick start" path in the README cannot succeed on
masteras it currently stands.Suggested fix
Bump the base image to
php:8.4-apacheto match thecomposer.jsonandcomposer.lockconstraints:PHP 8.4 is the current GA release and is the minimum compatible version implied by
composer.lock. No other Dockerfile changes appear necessary — thepdo,pdo_mysql, andmysqliextensions, plus Apache'srewritemodule, are all still installed the same way on PHP 8.4.I verified this locally: applying the one-line change above lets
docker buildcomplete successfully, includingcomposer install(28.5s), and the image builds end-to-end.I'm happy to send a PR with this change if it would help.