How to dockerize Symfony 5 project with Nginx and Postgres (using docker-compose)



How to dockerize Symfony 5 project with Nginx and Postgres (using docker-compose)

How to dockerize Symfony 5 project with Nginx and Postgres (using docker-compose)

In this tutorial I explain how to #dockerize #Symfony 5 application with nginx and postgresql database and integrate it with PhpStorm. I show how to create new Symfony project and configure docker both for local development and for production. Also I show:
* how to use docker volumes
* how to setup xdebug
* how to use PHP interpreter from docker in PhpStorm
* how to connect to docker Postgres database from PhpStorm
* how to use Makefile
* what to do in case of issues with docker

In this video I use Symfony 5 with PHP 7.4 but this tutorial is still relevant for older versions of Symfony framework or PHP.

⭐️ Final result you can find here ⭐️
🔗 https://github.com/Cap-Coding/symfony_docker

⭐️ Support channel on Patreon ⭐️
🔗 https://www.patreon.com/capcoding

⭐️ Resources ⭐️
🔗 Install Symfony https://symfony.com/doc/current/setup.html#creating-symfony-applications
🔗 Install docker https://docs.docker.com/engine/install/
🔗 Install docker-compose https://docs.docker.com/compose/install/
🔗 Install composer https://getcomposer.org/download/
🔗 Docker hub https://hub.docker.com/
🔗 Docker-compose mount flags: https://docs.docker.com/compose/compose-file/#caching-options-for-volume-mounts-docker-desktop-for-mac
🔗 Docker issue https://github.com/docker/for-mac/issues/77
🔗 Shared file access article https://medium.com/free-code-camp/speed-up-file-access-in-docker-for-mac-fbeee65d0ee7
🔗 Docker-sync http://docker-sync.io/
🔗 How to get host IP address (and not only) https://nickjanetakis.com/blog/docker-tip-35-connect-to-a-database-running-on-your-docker-host
🔗 Symfony performance http://symfony.com/doc/current/performance.html
🔗 Book O’Reilly “Head first design patterns”
Amazon: https://amzn.to/2KVHD0D (new edition)
Amazon: https://amzn.to/2NMfTN9
Amazon DE: https://amzn.to/2Xq3TCt

🎥 All Symfony tutorials https://www.youtube.com/playlist?list=PLKQc-wMFDsrEt6U5LKLETR2d4nhW0ieNI

Get € 20 on Hetzner Cloud hosting:
💲https://hetzner.cloud/?ref=GyXEuMSuxUBq

Register domain without hassle on GoDaddy
💲https://letyshops.com/r/godaddy-87becf0c4e38

⭐️ TABLE OF CONTENT ⭐️

00:00:00 Introduction
00:01:31 Create Symfony project
00:02:51 Configure Docker for local development
00:17:41 Setup xdebug
00:24:38 Configure Docker for production
00:30:05 Shortcuts with Makefile
00:31:55 Troubleshooting

Comments are closed.