LAMP Compose Revisited

Cross-Referencing the LAMP Stack's Compose File from Volume 3

LAMP Stack Development (A LAMP Stack in Docker Compose) ran a LAMP stack from a compose.yaml with a web service (Apache with PHP 8.5, built from an inline Dockerfile) and a db service (MySQL 9.7 524 ). BookNest's file has the same shape, and the differences show which choices belong to the application rather than to Compose 514 :

The LAMP stack's Compose file and BookNest's compared
Concern LAMP stack (LAMP Stack Development) BookNest
Application image dockerfile_inline in the YAML Multi-stage Dockerfile (Multi-Stage and BuildKit)
Source code Bind-mounted ./src Copied into the image
Database mysql:9.7, dbdata volume postgres:18, pgdata volume
Startup order Healthcheck and service_healthy Plain depends_on for now
Credentials Literal values in the file ${...} with defaults and .env

The LAMP file bind-mounts its PHP source because PHP rereads files on every request, which suits development; BookNest bakes its code into the image so that the tested image is the one that runs, and keeps bind mounts for development (Bind Mounts). BookNest still lacks the LAMP file's healthcheck condition; Up, Down, Rebuild shows why it matters. Laravel Sail 1,922 (LAMP Stack Development, Laravel Sail and Docker) is a generated compose.yaml plus a wrapper script.