We often work with systems that run on different software versions. Therefore, we need tools that allow us to compile / interpret / execute our code according to the context where we are.
In this article we will see how to create a development environment with Docker that will allow:
- Use multiple PHP containers with different versions (in this guide we will install FPM 7.4 and 8.2).
- Configure an Nginx container as a web server to redirect requests to the PHP container that should act as interpreter based on the URL and port.
I will explain everything in detail, but I understand that you know Docker and how it works.
Getting started with Docker
You need to have Docker installed on your machine. After that, if you don’t have a Docker Desktop environment, you can use Portainer for quick management of all your containers.