Additional notes about Laravel with Docker
In this section, we will use the same infrastructure we created in Chapter 1, Understanding the Core Concepts of Laravel 5. Using the PHPDocker.io
generator, we will customize it in order to understand a little more about what is happening inside the Docker container.
So, let's go into a more detailed explanation, and there's nothing better than getting our hands dirty.
Creating the Docker Compose foundation
First, we are going to create the foundation (Dockerfile
, docker-compose
) files for the application, different from the way we did in the first chapter. Instead, we will create the files manually, but based on the files we used in Chapter 1, Understanding the Core Concepts of Laravel 5.
Follow these steps:
- Create a folder called
chapter-04
. - Inside the
chapter-04
folder, create a folder calledphpdocker
. - Inside the
phpdocker
folder, add two folders, one callednginx
, and another calledphp-fpm
.
Configuring nginx
Now, it's time to create the configuration...