here are many ways to deploy your symfony app in Docker container, here we are going to use 3 containers : We will use “Docker compose” which helps us to create many containers using one main file called : docker-compose.yml. To hav e a clean architecture, we’ll create a directory called “docker”; inside that directory, create 2 sub-directories. As you can see below I created : In this container, we’ll use this image : php7.4-apache and install some mandatory packages to execute installation’s scripts.
In our container, we principally installed : As you can see in the image above, we have a sh script; it is to launch the symfony server using the symfony-cli directly in our application, you can find below his content.
I decided to configure the phpMyAdmin container directly in the docker-composer.yml file, but of course you can create a directory and process like the others.