Setting up our PHP development container
We will need a development environment for our PHP application. We will be separating our development environment structure into two main parts: the Docker container (server) and the PHP application.
The docker
directory will contain the following:
Dockerfile
docker-compose.yml
- Server configurations
The codebase
directory will serve as the following:
- The root directory for our PHP application
- Vendor directory for composer packages
Now, let us set up our PHP development container:
- Create the following directory structure in your machine:
Figure 3.1 – Base tree
- Run the following commands:
$ mkdir -p ~/phptdd/docker
$ mkdir -p ~/phptdd/codebase
- Install Docker Desktop. Before we create the required Docker files, we will need to download and install Docker Desktop.
For macOS users, Docker can be downloaded from https://docs.docker.com/desktop...