finds.dev

BretFisher/php-docker-good-defaults

*WORK IN PROGRESS* sample PHP/Laravel app for Docker examples

View on GitHub

★ 371DockerfileMITupdated Dec 2021

// the take

A reference Dockerfile/docker-compose setup (not a real app) showing how to run Nginx + PHP-FPM + Composer for a Laravel-style PHP stack in Docker, aimed at ops people setting up Docker for PHP teams rather than PHP developers themselves. It's meant to be copied piece by piece into your own project, not run as-is.

Layer ordering is correct: it copies composer.json/package.json and installs dependencies before copying source, so rebuilds don't blow the cache on every code change. The node_modules-outside-approot trick avoids bind mounts clobbering installed packages in dev. It uses a Dockerfile HEALTHCHECK against PHP-FPM's /ping route, which is more useful than the common 'container is running so it must be healthy' default. The README is upfront about the Supervisor-managed Nginx+PHP-FPM single-container pattern being a deliberate exception to one-process-per-container, with the author's reasoning for it.

Explicitly marked WORK IN PROGRESS and the last push was December 2021 — almost four years with no commits, so there's no guarantee the base images, Composer/npm versions, or Supervisor config still work with current PHP or Node releases. The author states outright he isn't a PHP/Laravel developer, and even points you to Laravel's own official Sail tooling as the better choice if you're actually doing Laravel work, which undercuts the repo's own pitch. There's no real application code to validate the setup against — it's Docker plumbing with a placeholder app, so you can't tell if it holds up under real framework upgrades or dependency changes. No CI, no tests, and the Nginx+PHP-FPM-in-one-container approach means you lose independent scaling and the ability to restart/update one service without touching the other, which matters once this leaves 'local dev' and someone tries to adapt it for production.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
371
Forks
119
Language
Dockerfile
License
MIT
Last commit
14 Dec 2021

// nearby

If php-docker-good-defaults isn't quite it.

All repos →