Thanks for this, I've been jumping around articles/videos and have ended up being tied in knots trying to get this to work on my local comp. This was a solid run through for getting up and running without getting too bogged down and it was lucid in its approach - additionally most other tutorials seem to skirt over the server config which you went through here. I rarely comment on YT videos but when i do it's to tell you simply that you deserve to have an excellent day.
@resilientbit4 жыл бұрын
That's how a tutorial should be. To the point & not a single second wasted. Awesome! 👍
@EzekielOladejo-f1u Жыл бұрын
This is probably the only tutorial I have seen on dockerizing a Laravel application that is straight to the point and easy to understand. Thanks Andrew!!
@aschmelyun Жыл бұрын
I'm glad you liked it, that means a lot to me! You're welcome!
@GKSchattenjaeger4 жыл бұрын
Sir, your guide was clear and concise, it provides a perfect starting point for those who learn easier from an audio presentation (and not only). Thank you.
@compelledcatholic6341 Жыл бұрын
I know I'm commenting on an older video, but I just wanted to say thanks. This was very helpful. I thought I would stick my toes in the PHP waters just to check it out. I was struggling to find a good way to set up a dev environment without setting up a whole stack locally... not to mention, that it could then be the start point for a production branch (I found that video first). I watched dozens of videos that just referred to something like this or just glossed over the whole process. This video plus your deployment video completed the picture that I was missing in my mental model, with all the nuances of docker and compose to tie a bow on it.
@KristherLouisVidal5 жыл бұрын
The best video on docker hands down! Please make a followup tutorial on how we can connect sequel pro with mysql and custom domain mapping.
@aschmelyun5 жыл бұрын
You got it!
@aschmelyun4 жыл бұрын
In case you haven't seen it, it's out now! kzbin.info/www/bejne/pauuqYqppM-MgJY
@FunkyToe3695 жыл бұрын
Could you explain the purpose of the SERVICE_TAGS and SERVICE_NAME? I don't see it listed in the mysql docker hub so I am not sure what it does.
@deepeshdhakal74763 жыл бұрын
thank you this worked like magic. Not only learned how to make laravel work but also setting up webserver in general was a great learning experience.
@laizenwar Жыл бұрын
This is exactly what I was looking to know how to do. Thanks for the tutorial. Straight to the point
@aschmelyun Жыл бұрын
Awesome, I'm glad it helped! If there's any improvements I could make to this video since it's a bit old now, feel free to let me know!
@winter-survivor3 жыл бұрын
You rely on having a PHP installation on the host machine to get Composer packages instead of installing Composer on the desired container via Dockerfile. Is this the recommended practice? Thanks for the tutorial, very helpful.
@tannercampbell4 жыл бұрын
@Andrew Schmelyun Do you know of a way to install composer directly inside the docker environment, instead of relying on the local machine version of composer to build the new larval project instance?
@pauloafonsop.a11464 жыл бұрын
I don't think this is a good thing... because I think you have to configure your environment in a distinct moment that you install / work with your versioned laravel project... you have to be able to download the laravel project at any moment of the project development, using for example a git clone ..., mainly when your project is already created and your environment is already configured and stable. So first of all you configure your docker-compose to build your enviroment, and then, in a paralel way, you create your laravel project. After that, whenever somebody joins in your team, that person clones your your laravel git repository and then build and up your docker environment. If you put the command to install a new laravel project using composer inside your docker, whenever you build your container you create a new laravel project, that I don't think this is a good idea. Your docker-compose is to you create and up your environment...
@Mostaqmahmud4 жыл бұрын
Best one....best one...best one....!!!! I didn't get any clear understanding video like this. Thanks... Love you man... ❤
@bricxcarasco49214 жыл бұрын
This is a great tutorial man, it's very clear and easy to understand. Keep it up sir, from the Philippines.
@AliasdHacker2 жыл бұрын
Well done, and very much appreciated. I just started a php project for the first time in about 10 years, this got me up and running very fast.
@hassanawodi58884 жыл бұрын
One of the best tutorial on this! Well done. Straight forward and on point.
@jahedhmahmud14484 жыл бұрын
amazing tutorial, good pace to keep up with and just the right amount of information on every thing that is done (allowing us to google for further information if needed). Excellent keep up the great work!
@FaizanAnwerAli4 жыл бұрын
You can make couple of videos with docker-compose and Laravel. 1. Memcached for caching. 2. Redis connection for session. 3. Media storage 4. Local ssl 5. Deployment on cloud. Including Heroku, AWS and Google Cloud. 6. Php Ratchet socket connection app in docker. I have been looking for these for last 4 months. Just subscribed to keep my self updated on these videos if you upload them
@tannercampbell4 жыл бұрын
Great Video Andrew!! Been looking for a great video Laravel setup in Docker and this was it!
@hencoburger4 жыл бұрын
This was awesome! Helped me allot to get things up and running quickly.
@GagandeepSingh-op8mb4 жыл бұрын
Still the biggest problem I face here is when we do composer install outside docker, we are still relying on local php version. Like I need php > 7.2 on the machine(not inside docker) to install laravel 7. Please correct me if I am wrong and let me know if there is any solution for this.
@tictechstory79792 жыл бұрын
This is what I am looking for, Great work Man👏
@luongkhang14622 жыл бұрын
Thank you so much for this. Even watching your clip it cost me whole day to do, can't imagine without this clip how much time i will cost T.T
@emblemcc4 жыл бұрын
No matter how I tried I made so many typos :) but now I"m more familiar with the syntax .. thanks a lot
@njtuts58182 жыл бұрын
Brilliant presentation ......................... Thanks Andrew
@imazumder993 жыл бұрын
Thank you so much for this video. Easy to understand. Short and to the point.
@maurotrotta13703 жыл бұрын
Thanks Andrew! It was exactly what I was looking for!
@willyboy19854 жыл бұрын
For those having issues with the storage/logs/laravel.log permission, add those 3 lines to the Dockerfile RUN echo dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data RUN chown -R www-data:www-data /var/www/html - 1st line downloads a package to allow alpine to use the command `usermod` - 2nd line uses usermod command to add user www-data and group www-data to the user ID 1000 and group ID 1000 - 3rd line changes the owner and group of the project folder to www-data
@dotancohen4 жыл бұрын
I'm a bit torn about this solution. The problem is that the UID and GID of files inside the volume must be the same values as the UID and GID outside the volume, on the host. This solution forces the www-data UID and GID to match a common UID and GID. It will work for most users, but it's a workaround with faults that will be difficult to work around later. If I come up with a way to set the UID and GID in the volume independent of their values on the host, I'll post back.
@willyboy19854 жыл бұрын
@@dotancohen Many large docker projects such as Laradock have 1000 hardcoded in their dokcerfiles for uid and gid. I am not saying that they are necessarily right to do so, but it does seem like having 1000 as your ID on your own machine is "almost-certainly-always" the case. If you are that concerned about ID disparities, you can set some `args` in your docker-compose such as UID: 1000 GID: 1000, and pass them dynamically in the Dockerfile.
@gayanhewa4 жыл бұрын
Good stuff, I like the format you have used to explain each step as you go through them. I hadn't used docker-compose in a while and wanted a refresher to get it sorted for my local projects. This was more than enough to refresh my memory. +1
@aschmelyun4 жыл бұрын
Thank you so much Gayan, comments like this are what keeps me going!
@siliconmachine5 жыл бұрын
This is great! I hope you upload more content like this. Been fighting with it for a couple of hours and you made it super clear. I'd just suggest you add the link to the repository :) Thank you!
@aschmelyun5 жыл бұрын
Thank you so much, I'm glad you liked it! Not sure if you saw it in the other comments, but the repo is github.com/aschmelyun/docker-compose-laravel
@rogerpence5 жыл бұрын
This is a very helpful video. But one thing is bugging me! You ran composer locally, correct? Why? I don't have, nor do I want, PHP and composer installed locally. Couldn't you use docker-compose exec into the PHP container to run compose create-project? (if the PHP container doesn't have composer installed, you could do that in your Dockerfile.)
@aschmelyun5 жыл бұрын
You're 100% correct! I just happen to have composer and PHP installed locally on my machine for installing packages + running create-project, but if you wanted you could offload that entire functionality to your docker containers. The best method would be to create a new container in your docker-compose file built off of the Composer image. This SO thread has a lot of great info in it: stackoverflow.com/questions/48127851/how-to-use-composer-with-docker-compose
@rogerpence5 жыл бұрын
Andrew Schmelyun Thank you, Andrew. Ive been using Docker for a while now but you turned on several light bulbs for me.
@stephenkaruku83842 жыл бұрын
Thankyou man...this video is exactly what I was looking for
@AkeelAmeen3 жыл бұрын
Great tutorial, Simply explained! Thank you for this
@TricoliciSerghei2 жыл бұрын
Thank you Andrew, I love you (figuratively)!!
@leoliu85464 жыл бұрын
One of the best Docker Tut
@dantharx3 жыл бұрын
Excellent Video! Thank you for sharing your knowledge with us. Did I miss the part where the database was created (before the migration at the end)?
@paradiseofcreativity2 жыл бұрын
This is great, out of the box. Really helped me a lot. You're a life saver..
@aschmelyun2 жыл бұрын
I'm glad it helped, thanks for the compliment!
@dorsetdroneguy58044 жыл бұрын
Exactly what I was looking for. Thanks
@igoralves13 жыл бұрын
Very good. Just a note - I faced an issue during the first test. But when I cloned from the repository all was good.
@rezarabbani53353 жыл бұрын
set playback speed on 0.9 and enjoy this perfect tutorial
@CalicoArchives3 жыл бұрын
Thanks for making this video. Very well explained and easy to follow. Subscribed.
@rahulxcr2 жыл бұрын
Thanks. This is a great tutorial, simple and to the point.
@vladvald8644 жыл бұрын
Hey, nice video, but I have a question: why does it take so much time to make a simple request/response (im not good at this stuff, but when im using xampp, time is incomparably small, so im not sure how to use docker for development).
@hasankaraca18002 жыл бұрын
Thanks Man, very good explanation.
@izclubcom4 жыл бұрын
i have an error: Exited (0) 8 seconds ago when using docker ps -a When i run project is: 502 Bad Gateway nginx/1.18.0 Please help me
@kazemmirzaei2174 жыл бұрын
Thank you so much, Awesome!!! Could you explain what should I do in production mode? and Isn't it better to go with Laradock?
@atipatlorwongam2 жыл бұрын
This way you'll still have to install "composer" onto the host machine, in order to create project in the src directory right? is there any dockerized way around that?
@arun57413 жыл бұрын
JUST GOT AMAZED WITH THE SPEED OF yOU ARE DOING .. CAN YOU PLEASE BE MY MENTOR?
@rdhdFAN3 жыл бұрын
Trying to learn Laravel but all the configuration needed to run on Windows is absolutely nuts. Even with Docker. At this point I'm really questioning why I don't just stick with a simple LAMP stack.
@fruzsinakovacs62624 жыл бұрын
Very useful video, thanks for making it. It should definitely have more likes.
@saeed904112 жыл бұрын
every command worked😄it was very helpful. but I do not understand two things, how is composer working in php container? we do not have composer installed in there. and after that , how we do not need rebuild for docker-compose after changes?
@dennyrachmadi13912 жыл бұрын
Thank you for this. clear as glass
@sauravchauhan1628 Жыл бұрын
You made my day, many thanks
@joshua0x3 жыл бұрын
Such a great video. You just gained a subscriber
@bbqengineer33083 жыл бұрын
Does your Laravel + Docker course address extending Laravel Sail or only Docker from scratch? Does it cover Sail? Thanks in advance!
@KevinAround4 жыл бұрын
This is really cool -- I'm trying to setup Laravel on my Synology NAS (to host my laravel applications on my boat). Still pulling out my hair a bit, but progress :) Thanks for you!!
@aschmelyun4 жыл бұрын
On your BOAT?! That's awesome, haha! If you get stuck again and need any help, feel free to message me.
@suvradiproy19462 ай бұрын
Excellent Video, thanks a lot!
@rantayar4 жыл бұрын
i get error "502 Bad Gateway "
@universos12124 жыл бұрын
x2
@codepilot2766 Жыл бұрын
Hi @andrew I've followed exactly same thing. But when I try to create the laravel project with composer command, it throwing me error: zsh: command not found: composer
@veoquenoesunproblema3 жыл бұрын
It looks like the Nginx does not work properly when I execute the complete compose file, it suddenly stops.
@hectorluis92943 жыл бұрын
Dude the explanation was excelent, but can you tellme wich keyboard are you using? the sound of the typing was a true SRM
@BlackThreadDev2 жыл бұрын
Lol... Yes. You should do some affiliate marketing!
@olexiymelnychuk72745 жыл бұрын
You greatly awesome! I watched a lot of trash tutorials, and nothing helped me. But your tutorial is the best!
@АлекандрМарченко-д6г2 жыл бұрын
Hello. Can you show how to build the environment for Laravel-nodejs-pusher-echo-websocket project?
@programmingwithashwani46523 жыл бұрын
thank you so much ! Andrew Schmelyun
@АлінаСавчук-т4л4 жыл бұрын
ERROR: for mysql Cannot create container for service mysql: invalid volume specification
@spiderdev20102 жыл бұрын
Dont know what the issue always showing nginx welcome page... Can you help me in that sir?
@muhammadnasser27353 жыл бұрын
The Compose file './docker-compose.yml' is invalid because: Unsupported config option for services.mysql: 'try
@clydeortega37663 жыл бұрын
during running docker-compose exec php php /var/www/html/artisan migrate. it says, "Could not open input file: C:/Program Files/Git/var/www/html/artisan", i can't find any resources to solve this problem,
@alexios43924 жыл бұрын
Do you have to have installed all packages like nginx, php, mysql before running docket or does it install it?
@andriisukhoi5672 Жыл бұрын
Super! Thank you very much Sir!
@vladvasilov4 жыл бұрын
Great tutorial! But unfortunately this type of configuration will run really slow...have any thoughts about this? Thanks
@chrisdedavid18602 жыл бұрын
4:00 I wish you had explained "volumes:" a bit more. I don't understand what that is defining, and why you set those 2 directories.
@alexdorrington2 жыл бұрын
I cannot get this to work. I was using an existing laravel project. Placing it inside a src directory with the docker files as siblings is building and spinning the containers up but my browser refuses to connect
@ibolt7953 жыл бұрын
Great video! "Additional property mysql is not allowed error "---- anyone else getting this?
@RolandoRamosTorres9 ай бұрын
Great tutorial!!!! Thanks!!
@Thomas-ft6qs2 жыл бұрын
Hi, I am wondering how to make docker do the migrations automatically when doing docker-compose up. Have you got an idea?
@parisanaderi16473 жыл бұрын
Thank you so much. I tested this. after running docker-compose up -d, php and mysql and nginx are done but localhost:8088 is not running and return "Unable to connect". What is the problem?
@jacobward88514 жыл бұрын
So I did everything as shown and everything seemed to have worked but what I do notice is the docker container nginx doesn't stay up it always shows that it was exited when I run docker ps -a any idea why that would be?
@aschmelyun4 жыл бұрын
What's the output if you just run "docker-compose up nginx" without the -d flag or anything else?
@Nurhuda-xm9ek4 жыл бұрын
if you use the Compose docker, can we use more than 1 program, or only for 1 program only?
@arshchoudhary51984 жыл бұрын
Well done Andrew, I have a query how can we setup multiple laravel environment with docker?
@1337kaas3 жыл бұрын
What keyboard are you using? it sounds so satisfying :D
@kenjohnsiosan97074 жыл бұрын
Hi Sir, my nginx container is not running but mysql and php containers does successfully...where i am possibly wrong? thanks
@binodmanandhar53183 жыл бұрын
Hi Andrew, I am a new to docker. Just a beginner. When I run docker-compose build && docker-compose up -d command, I get this error ERROR: In file './docker-compose.yml', volume must be a mapping, not an array. I could not figure out the issue.
@ievatenav3 жыл бұрын
Thanks! Really good and quick! :)
@shakirbaba39782 жыл бұрын
Hi, leva. Are you able to run laravel app using docker?
@soduno5964 жыл бұрын
Thank you so much. You made me understand docker :)
@aschmelyun4 жыл бұрын
Glad I could help!
@aimfreakify4 жыл бұрын
Just curious at this point... I was creating my laravel app inside the 'src' directory, but kept getting the following error: composer create-project laravel/laravel . Creating a "laravel/laravel" project at "./" Installing laravel/laravel (v8.4.2) - Installing laravel/laravel (v8.4.2): Extracting archive No such zip file: 'C:\Users\Sungho\dev\docker-practice\src/vendor/composer/tmp-1105d76acb6dfe5ee95dff2b5085bc5e' Unzip with ZipArchive class failed, falling back to unzip command Install of laravel/laravel failed [RuntimeException] Could not delete C:/Users/Sungho/dev/docker-practice/src/.: This can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed I was able to solve the issue by doing composer create-project laravel/laravel . /src while in the root directory. If anyone has any ideas why it was erroring out, it'd be much appreciated. I'm at least 90% sure this is just user error on my part. At this point, just very curious on wth was happening.
@rianasmaraputra4 жыл бұрын
When i create laravel project on src folder, and access the url, i always got 404 Not Found. How can i fix this ? Thanks
@fraj12344 жыл бұрын
Define working_dir: /var/www/html in nginx and php services
@quangminhpham18172 жыл бұрын
amazing course
@miraclemaddymm36944 жыл бұрын
hello there i am facing an issue which is the site cannot be reached...my nginx is running but other things not showing
@AlejandroDeLuca3 жыл бұрын
Great explanation. Thanks!
@bernardchisumo40543 жыл бұрын
could you set up Docker for multiple projects?
@skipydie11 ай бұрын
Hi. One question: Why do we need a php container separated from the nginx web server and why it works? Im used to work with Apache and instaling the php there
@aschmelyun10 ай бұрын
PHP is synchronous, it can only handle one request at a time. This is why we use web server applications like Nginx or Apache, they enable multiple streams of traffic to be divided into different PHP threads, handling concurrency.
@81gamer814 жыл бұрын
Been annoyed with wamp for so long. MS nailed it with blocking my hosts file evry so often these days. Hopefully this will work
@persoulrpg4 жыл бұрын
Hi, thanks for the video. Does docker-compose run mysql_secure_installation implicitly? Because I haven't seen you doing it.
@azzamjiul2 жыл бұрын
This video is awesome!
@gjvidz4 жыл бұрын
Hey Andrew, quick question. Do you need to have composer installed in you local machine to create a new laravel project or we’re you able to use composer from the php container?
@aschmelyun4 жыл бұрын
Hey John! You can use the PHP container if you install it as a dependency, but you should check out the GitHub repo pinned. I just updated it with info to use Composer to install Laravel from scratch without having to have it installed locally!
@gjvidz4 жыл бұрын
Andrew Schmelyun thanks for the reply Andrew! Will definitely check it out.
@deolhonaboia-pescaria4 жыл бұрын
Thanks so much! Saved my life!
@valentindobrica95843 жыл бұрын
Hey brother is there any way to automatize the database on laravel to run the migrations automatically on docker-compose build ?
@miguelstevens30425 жыл бұрын
Thanks for this video, for me the last step, adding a custom laravel route isn't working. Any idea what could be the cause of this?
@Scratch9243 жыл бұрын
If anyone looking for a solution. Add the following code inside nginx/default.conf inside server before location ~ \.php$ code: location / { try_files $uri $uri/ /index.php$is_args$args; }
@JeeteshNariya4 жыл бұрын
I don't want to use a composer in the local environment , can we use composer ras service or images?