How to run your PHP app in docker with MySql
HTML-код
- Опубликовано: 22 июл 2024
- Docker is an amazing tool for containerization. It can be used to easily run your application with desired versions and desired services.
In this video I will take my PHP MVC Framework which I built before on this channel
and run it with docker.
🐳 Setup fully functional Docker environment on Windows
• Docker Complete Setup ...
See how I build PHP MVC Framework
🎬 Videos 🎬 - bit.ly/3B0MH9y
⭐️ Source Code ⭐️ - bit.ly/3B1oYpZ
Table of Contents
----------------------------
00:00 - Intro & Overview
01:17 - Create Dockerfile
02:58 - Create Apache virtual host file
03:34 - Create composer installer
05:23 - Create php.ini
06:07 - Build an image with Dockerfile
07:02 - Run docker image
08:35 - Run commands in container
09:23 - Test php.ini configuration
09:50 - Create docker-compose.yml
12:03 - Stop container
12:28 - Start container stack
14:15 - Execute command using docker-compose
15:15 - Run migrations in container
15:39 - Connect to the database with MySql client
16:44 - Create MySql config file
17:54 - Bind mysql-data volume to avoid data lost
20:25 - The End
Support me by subscribing - bit.ly/2xTQOI0
Follow me on social media:
/ thecodeholic
/ thecodeholic
/ thecodeholic
Check my Github:
github.com/thecodeholic
such a useful guide man, thumbs up! i got my project working in 1hour and now i don't need to always update the code on my vps server for developing a fronted, huge props to you!
Well, that is just some quality content. Easy follow through and working. I love it (after several hours of reading documentation this is heaven).
What a nice comment ❤️
Thanks man, just finished watching the last video. Awesome work.
Happy to read such feedback. Thank you.
that's cool, appreciate your dedication
Wow just awesome, I just started to work for a company and they required me to quickly grasp and dominate docker, but in addition I need to fully comprehend laravel migrations, composer and mysql all in a dockrized file... if you could do tutorial on all thia man, right here you have a fan forever... I love the way you teach
OH MY GOD, I have no fucking idea what steps to follow to successfully complete my project, but THANKS TO YOU I have managed to create MY FIRST PHP PAGE VIA DOCKER. I have no experience using or installing docker, docker images etc. You are great. I love you. I can understand your pronunciation, I can understand your examples. I LOVE you. Thank you very much for your explanations
Your comment is so awesome.. Thanks a lot my friend.
Also the meme clips that you add to the edit are so funny , sarcasm is a powerful tool .
Thank you so much, keep up the good work
Thank you for your comment
Good idea!
amazing!
It is interesting to start building your framework
Go for it.
I think you will learn a lot.
very usefull 👍
Do you need for each project a docker folder? And what about a project which rum on php 7.4 and you want to test on 8.1 do you need 2 sort of configs which you have to paste in dockerfile each time you wan to switch php version?
Thank you.
Thanks, your videos are great.👍
I have a question, how can we add dynamic routing in this framework
Something like "product/:slug"
And have single product view to render the product with that specific slug?
I have a video on exactly that topic. Please check PHP MVC Framework playlist.
Great video. It would be cool if you did a video on moving your container to a Google Cloud VM
Just noting at the 9 minute mark that because the composer.json is not in the container, I was unable to install composer without first copying the composer.json contents from your github site to there. I had to also install vim in order to create the file there because I'm a n00b and couldn't figure out how to move the file there directly. Not even sure if I should need to move the composer.json to the /var/www file, but that's what I ended up doing to move forward.
Sir..! Could you make a video yii2 RBAC step by step.
will this method work if i use codeigniter 3 and posgresql 13?
Im still getting error: executor failed running [/bin/sh -c apt-get purge -y g++ && apt-get autoremove -y... Any ideas why this happening sir?
When ommited apt-get purge part i cant access that image in browser saying: localhost refused connection
Can this work with yii2 application? its been bugging me for a while.
iloveyou sir.
I was getting suspicious.
for some reason it wont change document root
Can someone please help me, I have got this error:
Connection failed: SQLSTATE[HY000] [2002] Connection refused
Champ! Just want to know how to implement multithreading in Php and perform Long running jobs. Preferably in yii2.
Hi Ali,
PHP does not have multithreading. The maximum result you can achieve is to start background scripts using shell_exec or exec and run PHP scripts (You can run yii2 console commands).
@@TheCodeholic thanks bro! that I have done already using scheduler thanks champ! It always worderful to get your response! Lot of Respect for you!
Pleas try to make a video on "Fibers" in php 8.1. How to use this.
@@AliHassan-wc6nb at the moment I have plans for at least next 10 videos, we'll see in the future
@@TheCodeholic I will wait till these 10 videos! Lol.
what about htaccess
Can you make docker linux setup video !
Yes I can, but there are already many videos on that topic
VSCode theme ?
Material theme High contrast
please tell me you have phpmyadmin in this too !
No, I don't have. Sorry.
I generally use other clients.
Either PHPStorm Database tool or MySql workbench.
In this video I connect to the database using MySql workbench. Which is free..
Ok.
ამის მერე ვისზე ნაკლებიღა იქნება ჩვენი frameworkი?!
😀 დავაი გავყიდოთ
Could you please help me? In the previous video we changed all namespaces. We created package from the core folder. However in this video we deleted the vendor and now I encountered this problem:
Fatal error: Uncaught Error: Class "Nirya\PhpMvcCore\Application" not found in /var/www/public/index.php:22 Stack trace: #0 {main} thrown in /var/www/public/index.php on line 22.
When I want to install the package again I encountered this problem:
Root package 'nirya/php-mvc-core' cannot require itself in its composer.json
How can I solve this problem? :(
very usefull 👍
Thanks