About this chapter
Time to use everything you've learned on a real, developer-focused example: running a PHP/Laravel application and its database with Docker Compose.
Lessons from courses
- 1 A Dockerfile for a PHP app Write a Dockerfile for a PHP/Laravel app: pick the php:8.4 base image, install extensions, copy code and install Composer dependencies.
- 2 Wiring the app and database with Compose Write a docker-compose.yml that builds your PHP/Laravel app image and connects it to a MySQL database, then run migrations with compose exec.