Source: germainowono.medium.com

Deploy Symfony app in Docker

Category: PHP, MySQL

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.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners