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!
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 :)
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 :)
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
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.
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
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.
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 th-cam.com/video/MmyxWy8jl7U/w-d-xo.html Loads of useful vids there. Derick created XDebug and he'll be happy to help you out.
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?
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
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.
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
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 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!
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.
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.
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!
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!
A true gem, so detailed and easy to comprehend.
Glad you enjoyed it... I appreciate the kind words
I already like it as I see the video description
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!
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
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 🤝
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!
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!
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! 💪
great! thank you!
This video has greatly helped me. Thank you Gary, this was really helpful
...another great video by Gary. Looking forward to see Symfony (simple dev "quickstart" version) dockerized :)
Thanks for yet another great tutorial!
You're welcome..thanks for watching it!
Sensational content, it was not difficult to understand, everything went well here, congratulations.
Thank you very much!
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 TH-cam
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!
Just what I was looking for!!
Glad I could deliver!
Very good! Thanks Gary!
woah! this is HUGE!
kudos!
Cheers Kevin...hope you enjoy!
Great tutorial, great and understandable explanations and practical cases, you got a new happy follower, thanks man!
Cheers and welcome aboard!
This video is useful for me. Thank you.
Glad to hear that
Love this channel! Wonderful resource... I'm learning a lot!
That's great news...keep going 💪
Awesome. Thank you so much. It's very helpful.
You're welcome...glad I could help.
thank you very much Sir. I learned a lot
Glad to hear that 🤝
Thank you for such great video Gary Clarke.
Welcome...thanks for watching!
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 your video
would you please kindly make one short course with swoole instead of nginx ? thanx
Thank you
Thank you very much. this lesson is great ❤
Glad you liked it!
Thank you!!
Nice video, thanks for the great work
Thanks for watching!
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
Yes Sir !
Watched till 17:05 (In case youtube doesn't remember)
Great tutorial.
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
th-cam.com/video/MmyxWy8jl7U/w-d-xo.html
Loads of useful vids there. Derick created XDebug and he'll be happy to help you out.
Thanks ! ! !
Composer finally meets Compose 😄
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
Hello, bro! I learn to PHP!
Keep it up!
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.
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
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?
super!
Thank you! Cheers!
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. 🤝👍
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
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
what's the code editor?
PHPStorm
muito bom
Obrigado
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
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.
nice but not beginner friendly
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
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?