This is an outstanding video. Some paid courses on Udemy are not as clear and helpful as this. You really get the idea that Gary wants you to understand what's happening, not just copy like a code monkey.
This is so great. You provide really thorough, detailed and clear explanations. And it is so refreshing to see modern PHP development being taken seriously. Thank you!
Thanks. I've watched umpteen videos on Docker but they all miss out, or fail to explain, key parts. Yours has finally made Docker understandable (ish!)
You really have the best teaching skills. I always had difficulty understanding the concept of construction (especially X-debug and Composer). Now I understand and I was able to apply it perfectly. Thanks!
Super helpful and helping the community and me a ton. Thank you so much. Literally saving my life. I've never used docker before and I just started in a development apprenticeship and could skip the first year but last time I coded anything was a few years ago and I never knew docker existed till recently through my boss wanting me to develop a app... using docker. So this is helping me out so much. Even if its nearly 2am
Awesome, to be honest for me It was a course of 3 days but with a lot of knowledge gained. Thanks for this video and as soon as possible the next course will be OOP. Regards form México :)
On 1:02 Hours of the course there is a command called "composer install". I do not have composer locally installed and I don't want to install locally on the MAC OS php and composer. Is there another way to get this up and running? Thanks a lot so far for this great tutorial.
This is such a great resource! I'm not even half way through but I love the pace and the content. Spot on dude! I've been working with DevOps for a few months now, and this seems like a great way to get the basics covered after diving head-in to multi-stage builds and Kubernetes deployments :)
Hi Gary, great content so far. My issue is that when I shell into my docker container my path is simply '/'. I've followed everything you've done and I still don't have var/www
Hi Gary, thanks for this video, it's just what I was looking for. A question: to install imagick adding "nstall-php-extensions imagick;" is enough ? Thanks
Yeah think that will be ok, it's on the list for mlocati/php-extension-installer Just check this list when you need to see if an extension is possible: github.com/mlocati/docker-php-extension-installer#supported-php-extensions
Wow! the video i was looking for. Absolutely awesome tutorials!! Gary can you also make a complete tutorial on making a php MVC framework from scratch, please. Cause this is also a undertought topic. You make easy to understand videos.
Hey Gary, would you dockerize an application before you actually start coding at all or is it an acceptable scenario to dockerize an app after you did some coding? I'm trying to dockerize a symfony application that I wrote but it seems that my code changes do not reflect on the container even though I'm using volumes. What do you think about this or what is the first thing that you would check up on in this regard? Thanks for the great content
It will always be easier to dockerize from the start but lots of applications get dockerized after a lot of code has been written. Most of the Symfony apps that I'm responsible for are dockerized.
Very nice video, thank you! It is really even better than the official quick course on Docker site (though the latter one is meant for dummies like me). I wanted to ask you, if you don't mind: I set up xdebug (not using your video, by using the guide from docker site), used "host.docker.internal" value, installed the same Chrome extension you are using in the tutorial, changed the IDE key in the extension to vsc (also tried another way - changing this parameter in VSCode settings), tried even adding port 9003 to ports section as "9003:9003" (though that does not seem necessary because I have not seen many tutorials mention this step) - but still xdebug is not working for me. I have Windows 10 22H2 in VMware, latest version of VSCode, PHP 8.3 and xdebug 3. What is most important, xdebug is working for me locally without Docker. Also, PHP Info page lists xdebug as enabled inside docker, so I guess it IS installed, but my IDE cannot receive the connection for some reason. My networking mode is "mirror host adapter", because it's the only way I can access my home Windows SMB share.
I've not done it in VSCode personally but give the XDebug playlist by @DerickRethansXdebug a go ua-cam.com/video/MmyxWy8jl7U/v-deo.html Loads of useful vids there. Derick created XDebug and he'll be happy to help you out.
Is necessary to keep volumes in web section for the production environment? .conf files are copied in nginx dockerfile so I think it's not but I preferred to ask.
Thank you Gary, I completed this super course entirely on an Apple Silicon. An immense value to me! It was so far the best course I've seen on the subject and the nicest thing, it's tailored exactly to my needs. Not too little, but not too much either. Just great! Please don't stop developing courses like this, I'm looking forward to the next one, maybe a detailed XDebug with all the subtleties for once?
Hallo Gary!. I am having a problem with the execution time of "imagecreationfromjpeg" (using php:8.1-fpm-alpine); it take minutes to do a jb that usually takes 100 milliseconds (create a jpg image from an url); I ried to install imagi in several ways but nothing change, so I am wondering if it could be a problem of php image. Have you any suggestion ? Many thanks in advance, Pierluigi
Yes..it could well be related to the php image. PHP and Docker have a history of performance issues but I don't know the solution to your problem off the top of my head. But my next steps would be chatgpt / google
Thank you very much. But please i have an error. When i try to test the mysql connection. I get this error. "Access denied for user 'user'@'%' to database 'my-db'"
@@GaryClarkeTech Please here is the docker compose file codes services: # server webserver: image: nginx:latest ports: - "9000:80" volumes: - ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf # php app: build: dockerfile: ./docker/Dockerfile volumes: - ./app:/app # db db: image: mysql:8.0 #preserving development data /var/lib/mysql is a folder in the mysql container volumes: - mysqldata:/var/lib/mysql ports: - "4306:3306" restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: p@ssw0rd MYSQL_USER: user MYSQL_PASSWORD: p@ssw0rd MYSQL_DATABASE: docker-db volumes: mysqldata: Initially, I was running it on windows and it was not working. But I just run it on mac and the connection is successful
If you have time create a content on dockers and permission and users on docker, for example: linux users for nginx, apache, laravel app and others. Anyway thank you
Hi Gary, I am having toubles with a simple php curl call to get mime type of a public file. From inside the container it seems tha curl is unable to access the file, like it was unable to resolve the url address: $ch = curl_init(".....something....); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $curlExec = curl_exec($ch); $curlExec is FALSE. Is there a setting to access public internet address I am missing ?
@@GaryClarkeTech I solved adding dns section in docker-compose file, app section. Now I upload wxternal files, but functions like "imagecreatefromjpeg" take ages to load this file; very boring. Thanks.
Hi Gary, Great video! I have followed this docker tutorial with great interest, and have already used the knowledge in several projects. However, there is something I can't figure out. My css and js files, loaded via a Link or Script tag, result in a 404. FYI I load the css file with the full link ("css/style.css" doesn't work either) I can't really figure out where the problem lies. Do you perhaps have an idea?
@@GaryClarkeTech The files are indeed in folders that are in the public folder. That's why I find it so strange that they can't be opened, but index.php can...
You could try keeping them in an assets folder and adding an additional location entry to your default.conf file, like so: location /assets { alias /var/www/html/public/assets; } Then to reference that file in your html, use this: You will need to rebuild your web container after this change.
@@GaryClarkeTech Thanks Gary for this solution, this does indeed work. I have now found the cause why it did not work before. You have to be pretty precise when it comes to docker file layout, I discovered through trial and error. But thanks for your solution, now I can move on to the actual development. ;-)
@@GaryClarkeTech can I just put it like this?, because my css for example is at the root of the project. location /css { alias /var/www/html/css; } In the HTML: is it right?
This is an outstanding video. Some paid courses on Udemy are not as clear and helpful as this. You really get the idea that Gary wants you to understand what's happening, not just copy like a code monkey.
This is so great. You provide really thorough, detailed and clear explanations. And it is so refreshing to see modern PHP development being taken seriously. Thank you!
Cheers Tony...glad it was helpful!
Thanks for this wonderful video. Will definitely use docker from now on.
Your newsletter is probably the most useful one I have ever subscribed to. Thanks!
I really appreciate that! People rarely unsub so I must be getting something right!
@@GaryClarkeTech 💪
Thanks. I've watched umpteen videos on Docker but they all miss out, or fail to explain, key parts. Yours has finally made Docker understandable (ish!)
That's great to hear! I hope that you're able to adapt what you've learned into your own stuff.
I have no idea how youtube keeps giving these insanely good recommendations, thanks for the video
Thanks very much for the kind words and thanks for watching!
1:32:29 How do you do this with a powershell terminal on windows?
You can try git bash
You really have the best teaching skills. I always had difficulty understanding the concept of construction (especially X-debug and Composer). Now I understand and I was able to apply it perfectly. Thanks!
Great to hear! Thanks for the kind words.
The way you explain it, simple and to the point. This is a great resource. Thank you.
You're very welcome!
Container docker-php-web-1
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/host_mnt/home/alexkiirundemi/Desktop/docker-php/nginx/conf.d/default.conf" to rootfs at "/etc/nginx/conf.d/default.conf":
29:55
I have the exact same issue, have you fixed yours?
Super helpful and helping the community and me a ton. Thank you so much. Literally saving my life.
I've never used docker before and I just started in a development apprenticeship and could skip the first year but last time I coded anything was a few years ago and I never knew docker existed till recently through my boss wanting me to develop a app... using docker. So this is helping me out so much. Even if its nearly 2am
Great to hear...keep going! 💪
Awesome, to be honest for me It was a course of 3 days but with a lot of knowledge gained. Thanks for this video and as soon as possible the next course will be OOP. Regards form México :)
Great to hear, Miguel..keep going! Respect from UK 🤝
I already like it as I see the video description
On 1:02 Hours of the course there is a command called "composer install". I do not have composer locally installed and I don't want to install locally on the MAC OS php and composer. Is there another way to get this up and running? Thanks a lot so far for this great tutorial.
Yes you can execute this inside the container..which is actually the best way to do it
docker compose exec app composer install
Thanks Gary 🙏 , Nicely and step by step explain. nice work done and keep it up. thank you once angain creating such quality content.
So nice of you..more to come!
This is such a great resource! I'm not even half way through but I love the pace and the content. Spot on dude! I've been working with DevOps for a few months now, and this seems like a great way to get the basics covered after diving head-in to multi-stage builds and Kubernetes deployments :)
Thanks buddy...I just wanted to get something out there that us regular PHP devs could understand...felt it was missing from the internet!
This video has greatly helped me. Thank you Gary, this was really helpful
Great tutorial. I was able to follow you from start till end doing it with laravel app.
Nice work...hope you can put all to practical use!
A true gem, so detailed and easy to comprehend.
Glad you enjoyed it... I appreciate the kind words
Amazing, thank you for this easy yet comprehensive tutorial. It helped me grasp certain concepts my brain refused to digest previously.
Great..I'm glad it worked for you!
...another great video by Gary. Looking forward to see Symfony (simple dev "quickstart" version) dockerized :)
At 36:07, what is the reason the port numbers need to be in quotes? I don't see how it is different to when you specified the Nginx port mapping.
You can do it with or without quotes...I usually use quotes just as a habit but I guess I'm not always consistent!
Nice tutorial sir, your courses have really been of immense value to me sir. Keep up the good work.
Glad to hear that..keep going!
Sensational content, it was not difficult to understand, everything went well here, congratulations.
Thank you very much!
You are a legend for this. Thanks so much, it's very easy to follow and understand.
Ah you're welcome...you're a legend for watching it! Cheers
Which ide u r using?
PHPStorm
Hi Gary, great content so far. My issue is that when I shell into my docker container my path is simply '/'. I've followed everything you've done and I still don't have var/www
Great tutorial, great and understandable explanations and practical cases, you got a new happy follower, thanks man!
Cheers and welcome aboard!
Hi Gary, thanks for this video, it's just what I was looking for. A question: to install imagick adding "nstall-php-extensions imagick;" is enough ? Thanks
Yeah think that will be ok, it's on the list for mlocati/php-extension-installer
Just check this list when you need to see if an extension is possible:
github.com/mlocati/docker-php-extension-installer#supported-php-extensions
Thanks for yet another great tutorial!
You're welcome..thanks for watching it!
woah! this is HUGE!
kudos!
Cheers Kevin...hope you enjoy!
Wow! the video i was looking for. Absolutely awesome tutorials!! Gary can you also make a complete tutorial on making a php MVC framework from scratch, please. Cause this is also a undertought topic. You make easy to understand videos.
Kind words...thanks very much. Yes my next full course for garyclarke.tech will be create a php framework. The preview will be on UA-cam
Very good! Thanks Gary!
Love this channel! Wonderful resource... I'm learning a lot!
That's great news...keep going 💪
This video is useful for me. Thank you.
Glad to hear that
Just what I was looking for!!
Glad I could deliver!
Thank you for this tutorial. For some odd reason the nginx/default.conf only works for me if I exclude the server_name directive.
Ah ok..could be interesting. Wanna share your setup and I'll look into it?
Thank you for such great video Gary Clarke.
Welcome...thanks for watching!
Awesome. Thank you so much. It's very helpful.
You're welcome...glad I could help.
would you please kindly make one short course with swoole instead of nginx ? thanx
Hey Gary, would you dockerize an application before you actually start coding at all or is it an acceptable scenario to dockerize an app after you did some coding? I'm trying to dockerize a symfony application that I wrote but it seems that my code changes do not reflect on the container even though I'm using volumes. What do you think about this or what is the first thing that you would check up on in this regard? Thanks for the great content
It will always be easier to dockerize from the start but lots of applications get dockerized after a lot of code has been written. Most of the Symfony apps that I'm responsible for are dockerized.
Very nice video, thank you! It is really even better than the official quick course on Docker site (though the latter one is meant for dummies like me).
I wanted to ask you, if you don't mind: I set up xdebug (not using your video, by using the guide from docker site), used "host.docker.internal" value, installed the same Chrome extension you are using in the tutorial, changed the IDE key in the extension to vsc (also tried another way - changing this parameter in VSCode settings), tried even adding port 9003 to ports section as "9003:9003" (though that does not seem necessary because I have not seen many tutorials mention this step) - but still xdebug is not working for me.
I have Windows 10 22H2 in VMware, latest version of VSCode, PHP 8.3 and xdebug 3. What is most important, xdebug is working for me locally without Docker. Also, PHP Info page lists xdebug as enabled inside docker, so I guess it IS installed, but my IDE cannot receive the connection for some reason.
My networking mode is "mirror host adapter", because it's the only way I can access my home Windows SMB share.
I've not done it in VSCode personally but give the XDebug playlist by @DerickRethansXdebug a go
ua-cam.com/video/MmyxWy8jl7U/v-deo.html
Loads of useful vids there. Derick created XDebug and he'll be happy to help you out.
Is necessary to keep volumes in web section for the production environment? .conf files are copied in nginx dockerfile so I think it's not but I preferred to ask.
Not necessary for prod but handy to have during development cos it means no need to rebuild when you make changes
Ohh... Of course... Thank you very much@@GaryClarkeTech
Realy good video and the course. 🤝👍
Nice video, thanks for the great work
Thanks for watching!
thank you very much Sir. I learned a lot
Glad to hear that 🤝
Thank you very much. this lesson is great ❤
Glad you liked it!
Watched till 17:05 (In case youtube doesn't remember)
Thanks for your video
Great tutorial.
Thank you Gary, I completed this super course entirely on an Apple Silicon. An immense value to me! It was so far the best course I've seen on the subject and the nicest thing, it's tailored exactly to my needs. Not too little, but not too much either. Just great! Please don't stop developing courses like this, I'm looking forward to the next one, maybe a detailed XDebug with all the subtleties for once?
Great job! You'll be building all your own images before you know it! Lots more to come.
Hallo Gary!. I am having a problem with the execution time of "imagecreationfromjpeg" (using php:8.1-fpm-alpine); it take minutes to do a jb that usually takes 100 milliseconds (create a jpg image from an url); I ried to install imagi in several ways but nothing change, so I am wondering if it could be a problem of php image. Have you any suggestion ? Many thanks in advance, Pierluigi
Yes..it could well be related to the php image. PHP and Docker have a history of performance issues but I don't know the solution to your problem off the top of my head.
But my next steps would be chatgpt / google
Hi Gary, your website course looks great, but to me it's missing an auto-translated subtitle (like udemy or youtuber)
Fair feedback...we'll look at what options there are available.
@@GaryClarkeTech Thank You
Thank you very much. But please i have an error. When i try to test the mysql connection. I get this error. "Access denied for user 'user'@'%' to database 'my-db'"
Are your files the same as mine?
@@GaryClarkeTech please yes. I have checked.
Can you show me your docker compose file?
@@GaryClarkeTech Please here is the docker compose file codes
services:
# server
webserver:
image: nginx:latest
ports:
- "9000:80"
volumes:
- ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
# php
app:
build:
dockerfile: ./docker/Dockerfile
volumes:
- ./app:/app
# db
db:
image: mysql:8.0
#preserving development data /var/lib/mysql is a folder in the mysql container
volumes:
- mysqldata:/var/lib/mysql
ports:
- "4306:3306"
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: p@ssw0rd
MYSQL_USER: user
MYSQL_PASSWORD: p@ssw0rd
MYSQL_DATABASE: docker-db
volumes:
mysqldata:
Initially, I was running it on windows and it was not working. But I just run it on mac and the connection is successful
Thank you for patience and support
great! thank you!
No worries!
Why are you using tables plus as you are working with php-storm. Database editor is built right in
I've never liked the phpstorm one..don't find it easy to work with
Thank you!!
Thank you
Yes Sir !
Hello, bro! I learn to PHP!
Keep it up!
what's the code editor?
PHPStorm
Thanks ! ! !
Nice content thank you for share
Thanks for watching
If you have time create a content on dockers and permission and users on docker, for example: linux users for nginx, apache, laravel app and others. Anyway thank you
Composer finally meets Compose 😄
super!
Thank you! Cheers!
muito bom
Obrigado
It doesn’t work without context: .
You can’t compose up
Possibly your version of docker compose. I used v2. You can check by going to the settings ⚙️ in the Docker Desktop panel
@@GaryClarkeTech Thank you.
Hi Gary, I am having toubles with a simple php curl call to get mime type of a public file. From inside the container it seems tha curl is unable to access the file, like it was unable to resolve the url address:
$ch = curl_init(".....something....);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curlExec = curl_exec($ch);
$curlExec is FALSE. Is there a setting to access public internet address I am missing ?
Is it the same for all outbound addresses?
@@GaryClarkeTech Yes, different address, same error
@@GaryClarkeTech I solved adding dns section in docker-compose file, app section. Now I upload wxternal files, but functions like "imagecreatefromjpeg" take ages to load this file; very boring. Thanks.
Hi Gary, Great video! I have followed this docker tutorial with great interest, and have already used the knowledge in several projects. However, there is something I can't figure out. My css and js files, loaded via a Link or Script tag, result in a 404. FYI I load the css file with the full link ("css/style.css" doesn't work either) I can't really figure out where the problem lies. Do you perhaps have an idea?
What folder have you put them in? They will need to go in the public folder. They won't be accessible in outside of here.
@@GaryClarkeTech The files are indeed in folders that are in the public folder. That's why I find it so strange that they can't be opened, but index.php can...
You could try keeping them in an assets folder and adding an additional location entry to your default.conf file, like so:
location /assets {
alias /var/www/html/public/assets;
}
Then to reference that file in your html, use this:
You will need to rebuild your web container after this change.
@@GaryClarkeTech Thanks Gary for this solution, this does indeed work. I have now found the cause why it did not work before. You have to be pretty precise when it comes to docker file layout, I discovered through trial and error. But thanks for your solution, now I can move on to the actual development. ;-)
@@GaryClarkeTech
can I just put it like this?, because my css for example is at the root of the project.
location /css {
alias /var/www/html/css;
}
In the HTML:
is it right?