I’m new to Docker and Docker Compose. I want to run a Laravel API in one container and a React frontend in another.
Docker Hub has an image for Laravel, but I was told that isn’t best practice to use as we should start from PHP and add the necessary extensions needed by our application. Are there sources where they document writing framework-specific Dockerfiles?
I’ve seen Docker’s generic documentation on how to write Dockerfiles and use official base images, but I haven’t found framework-specific examples (e.g. Laravel API setup with PHP, MySQL, Redis, etc. plus a React app).
Is there official or community documentation for framework-specific Dockerfiles?
What’s the best way to learn to write a Dockerfile for a Laravel app?
Should I start from Laravel Sail or write my own Dockerfile from scratch?
Any good resources or examples you’d recommend?
I’m not aiming for production yet, but just a good dev setup where Laravel and React containers can talk to each other.