Create a Symfony 5 project with Docker PHP MySQL Nginx and Node - Part1 (2021)

preview_player
Показать описание
ℹ In this video I show you how to create a Symfony 5 project with Docker PHP, MySQL, Nginx, and Node using Docker and Docker Compose. This is the first of two parts in which I will create separate containers for Nginx, PHP, MySQL8, and Node. I'll connect the containers using a Docker Compose network so that everything just works in perfect harmony.

💻Link to the repo on github:

👇Follow me on Social Media:

💕Show support:
Рекомендации по теме
Комментарии
Автор

If you encounter any breaks with webpack encore when using node v15, try changing docker-compose.yaml to specify node:14

GaryClarkeTech
Автор

I was looking for something like this for a while, here i found everything. Great tutorial.

almerinobuce
Автор

Thank you for making this video. I've watched many hours of Docker tutorials this week after learning the basics, and this has been the only tutorial where things were explained very clearly. The bit about how to set up an nginx config file was invaluable.

jahoopyjaheepu
Автор

Thanks for the effort, Gary. I was able to get it running in no time!

nordicnoirmusic
Автор

This should help me! I've been trying to do this on my own for all day (except the node part, but I'll keep it on mind, it'll maybe be useful for a future project) switching between apache and nginx, both resulting in the same error : fcgi returning error.
Gonna try ur solution tomorrow, I hope it works this time!
Your tutorial is really good anyway, you explain well with a very comprehensive English for a French student like me. Thanks a lot for that!

phoenlx_
Автор

Hello Gary. Is there any reason for you not to use the unix socket for connecting php-fpm and nginx?

michaelbrauner
Автор

Great explanation with a very relaxed and easy to understand vibe!
Thank you and keep the excelent work.

goncalosardinha
Автор

thank you so much for this guide, few guides work right away and are modifiable for other projects. you have nailed it. keep up the great work my friend.

lexerquine
Автор

Thsnk you very much, you are my hero. I was traying to init a symfony app with docker and i was having a lot of problem to serve the statics files. Thansk to you I have succeeded

shurbioto
Автор

Thank you for sharing, it is a great video. What if I have multiple sites under Nginx, and want to keep each host conf in separate file?

yongzhang
Автор

Hi Gary, thanks, it is a great tutorial. I learned a lot. However, I ran into problem with php installation. While trying to figure out what went wrong, I realized, you were installing the docker on macOS so your dependencies are different then mine. I am using docker on windows 10 with WSL2 is "Debian10" for my port. So the requirements must be different. I did not however follow the recommended Debian way of installing PHP. I did trial and error.

Here is what I did....

FROM php:7.4-fpm

RUN apt-get update && apt-get install -y zlib1g-dev git libicu-dev zip libzip-dev zip \
&& docker-php-ext-install intl opcache pdo pdo_mysql \
&& pecl install apcu \
&& docker-php-ext-enable apcu \
&& docker-php-ext-install zip

MohammadArifRahim
Автор

Hey Gary, this is a great tutorial, thanks for that!

d.k.
Автор

Hy Gary,
great tutorial. However, I meet an error when I run the first docker-compose command:

[...]:~/project$ docker-compose up -d --build
Creating network with the default driver
Building php74-service
[+] Building 7.7s (3/3) FINISHED
=> [internal] load build definition from Dockerfile 0.9s
=> => transferring dockerfile: 596B 0.0s
=> [internal] load .dockerignore 1.2s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for docker.io/library/php:7.4-fpm
Do you have any idea where this might come from?
Thanks a lot.

jeromepatron
Автор

Could not be better. Thank you so much

domasdragunas
Автор

Thank you for great explanation!

I've done it all, but the localhost page didn;t show me that echo from index. It says that "Welcome to nginx! Nginx installed and working, but needs to be configured". Do you have any ideas where I could've made a mistake?

One thing if it's matters: I've typed php80 sign everywhere, not php74

d_sportello
Автор

Great video - it worked first time for me so I was super happy .... I hate configurating things, but this made it easy. Thank you for saving me a headache :)

PrincessSarahjayne
Автор

What if you need to change something does it take effect immediately or its like you need to restart the docker again

RdozeTV
Автор

Hi brother, my node container doesn't run at all, the rest are fine. thanks for tutorial

valentindobrica
Автор

Hello, thanks for the tutorial but I have some questions, my app is verly slow (loading on browser taking long time and also running commands on CLI) does the fact that Im using volumes that slows everything ? (Im using docker desktop on windows)

therealwalim
Автор

Thank you very much for your video. Very easy to understand the base concept!

Zoddxyz