Create a local Laravel dev environment with Docker

  Рет қаралды 198,656

Andrew Schmelyun

Andrew Schmelyun

Күн бұрын

Пікірлер: 314
@gordonrenfrew3632
@gordonrenfrew3632 4 жыл бұрын
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.
@resilientbit
@resilientbit 4 жыл бұрын
That's how a tutorial should be. To the point & not a single second wasted. Awesome! 👍
@EzekielOladejo-f1u
@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
@aschmelyun Жыл бұрын
I'm glad you liked it, that means a lot to me! You're welcome!
@GKSchattenjaeger
@GKSchattenjaeger 4 жыл бұрын
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
@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.
@KristherLouisVidal
@KristherLouisVidal 5 жыл бұрын
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.
@aschmelyun
@aschmelyun 5 жыл бұрын
You got it!
@aschmelyun
@aschmelyun 4 жыл бұрын
In case you haven't seen it, it's out now! kzbin.info/www/bejne/pauuqYqppM-MgJY
@FunkyToe369
@FunkyToe369 5 жыл бұрын
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.
@deepeshdhakal7476
@deepeshdhakal7476 3 жыл бұрын
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
@laizenwar Жыл бұрын
This is exactly what I was looking to know how to do. Thanks for the tutorial. Straight to the point
@aschmelyun
@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-survivor
@winter-survivor 3 жыл бұрын
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.
@tannercampbell
@tannercampbell 4 жыл бұрын
@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.a1146
@pauloafonsop.a1146 4 жыл бұрын
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...
@Mostaqmahmud
@Mostaqmahmud 4 жыл бұрын
Best one....best one...best one....!!!! I didn't get any clear understanding video like this. Thanks... Love you man... ❤
@bricxcarasco4921
@bricxcarasco4921 4 жыл бұрын
This is a great tutorial man, it's very clear and easy to understand. Keep it up sir, from the Philippines.
@AliasdHacker
@AliasdHacker 2 жыл бұрын
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.
@hassanawodi5888
@hassanawodi5888 4 жыл бұрын
One of the best tutorial on this! Well done. Straight forward and on point.
@jahedhmahmud1448
@jahedhmahmud1448 4 жыл бұрын
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!
@FaizanAnwerAli
@FaizanAnwerAli 4 жыл бұрын
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
@tannercampbell
@tannercampbell 4 жыл бұрын
Great Video Andrew!! Been looking for a great video Laravel setup in Docker and this was it!
@hencoburger
@hencoburger 4 жыл бұрын
This was awesome! Helped me allot to get things up and running quickly.
@GagandeepSingh-op8mb
@GagandeepSingh-op8mb 4 жыл бұрын
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.
@tictechstory7979
@tictechstory7979 2 жыл бұрын
This is what I am looking for, Great work Man👏
@luongkhang1462
@luongkhang1462 2 жыл бұрын
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
@emblemcc
@emblemcc 4 жыл бұрын
No matter how I tried I made so many typos :) but now I"m more familiar with the syntax .. thanks a lot
@njtuts5818
@njtuts5818 2 жыл бұрын
Brilliant presentation ......................... Thanks Andrew
@imazumder99
@imazumder99 3 жыл бұрын
Thank you so much for this video. Easy to understand. Short and to the point.
@maurotrotta1370
@maurotrotta1370 3 жыл бұрын
Thanks Andrew! It was exactly what I was looking for!
@willyboy1985
@willyboy1985 4 жыл бұрын
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
@dotancohen
@dotancohen 4 жыл бұрын
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.
@willyboy1985
@willyboy1985 4 жыл бұрын
@@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.
@gayanhewa
@gayanhewa 4 жыл бұрын
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
@aschmelyun
@aschmelyun 4 жыл бұрын
Thank you so much Gayan, comments like this are what keeps me going!
@siliconmachine
@siliconmachine 5 жыл бұрын
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!
@aschmelyun
@aschmelyun 5 жыл бұрын
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
@rogerpence
@rogerpence 5 жыл бұрын
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.)
@aschmelyun
@aschmelyun 5 жыл бұрын
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
@rogerpence
@rogerpence 5 жыл бұрын
Andrew Schmelyun Thank you, Andrew. Ive been using Docker for a while now but you turned on several light bulbs for me.
@stephenkaruku8384
@stephenkaruku8384 2 жыл бұрын
Thankyou man...this video is exactly what I was looking for
@AkeelAmeen
@AkeelAmeen 3 жыл бұрын
Great tutorial, Simply explained! Thank you for this
@TricoliciSerghei
@TricoliciSerghei 2 жыл бұрын
Thank you Andrew, I love you (figuratively)!!
@leoliu8546
@leoliu8546 4 жыл бұрын
One of the best Docker Tut
@dantharx
@dantharx 3 жыл бұрын
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)?
@paradiseofcreativity
@paradiseofcreativity 2 жыл бұрын
This is great, out of the box. Really helped me a lot. You're a life saver..
@aschmelyun
@aschmelyun 2 жыл бұрын
I'm glad it helped, thanks for the compliment!
@dorsetdroneguy5804
@dorsetdroneguy5804 4 жыл бұрын
Exactly what I was looking for. Thanks
@igoralves1
@igoralves1 3 жыл бұрын
Very good. Just a note - I faced an issue during the first test. But when I cloned from the repository all was good.
@rezarabbani5335
@rezarabbani5335 3 жыл бұрын
set playback speed on 0.9 and enjoy this perfect tutorial
@CalicoArchives
@CalicoArchives 3 жыл бұрын
Thanks for making this video. Very well explained and easy to follow. Subscribed.
@rahulxcr
@rahulxcr 2 жыл бұрын
Thanks. This is a great tutorial, simple and to the point.
@vladvald864
@vladvald864 4 жыл бұрын
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).
@hasankaraca1800
@hasankaraca1800 2 жыл бұрын
Thanks Man, very good explanation.
@izclubcom
@izclubcom 4 жыл бұрын
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
@kazemmirzaei217
@kazemmirzaei217 4 жыл бұрын
Thank you so much, Awesome!!! Could you explain what should I do in production mode? and Isn't it better to go with Laradock?
@atipatlorwongam
@atipatlorwongam 2 жыл бұрын
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?
@arun5741
@arun5741 3 жыл бұрын
JUST GOT AMAZED WITH THE SPEED OF yOU ARE DOING .. CAN YOU PLEASE BE MY MENTOR?
@rdhdFAN
@rdhdFAN 3 жыл бұрын
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.
@fruzsinakovacs6262
@fruzsinakovacs6262 4 жыл бұрын
Very useful video, thanks for making it. It should definitely have more likes.
@saeed90411
@saeed90411 2 жыл бұрын
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?
@dennyrachmadi1391
@dennyrachmadi1391 2 жыл бұрын
Thank you for this. clear as glass
@sauravchauhan1628
@sauravchauhan1628 Жыл бұрын
You made my day, many thanks
@joshua0x
@joshua0x 3 жыл бұрын
Such a great video. You just gained a subscriber
@bbqengineer3308
@bbqengineer3308 3 жыл бұрын
Does your Laravel + Docker course address extending Laravel Sail or only Docker from scratch? Does it cover Sail? Thanks in advance!
@KevinAround
@KevinAround 4 жыл бұрын
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!!
@aschmelyun
@aschmelyun 4 жыл бұрын
On your BOAT?! That's awesome, haha! If you get stuck again and need any help, feel free to message me.
@suvradiproy1946
@suvradiproy1946 2 ай бұрын
Excellent Video, thanks a lot!
@rantayar
@rantayar 4 жыл бұрын
i get error "502 Bad Gateway "
@universos1212
@universos1212 4 жыл бұрын
x2
@codepilot2766
@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
@veoquenoesunproblema
@veoquenoesunproblema 3 жыл бұрын
It looks like the Nginx does not work properly when I execute the complete compose file, it suddenly stops.
@hectorluis9294
@hectorluis9294 3 жыл бұрын
Dude the explanation was excelent, but can you tellme wich keyboard are you using? the sound of the typing was a true SRM
@BlackThreadDev
@BlackThreadDev 2 жыл бұрын
Lol... Yes. You should do some affiliate marketing!
@olexiymelnychuk7274
@olexiymelnychuk7274 5 жыл бұрын
You greatly awesome! I watched a lot of trash tutorials, and nothing helped me. But your tutorial is the best!
@АлекандрМарченко-д6г
@АлекандрМарченко-д6г 2 жыл бұрын
Hello. Can you show how to build the environment for Laravel-nodejs-pusher-echo-websocket project?
@programmingwithashwani4652
@programmingwithashwani4652 3 жыл бұрын
thank you so much ! Andrew Schmelyun
@АлінаСавчук-т4л
@АлінаСавчук-т4л 4 жыл бұрын
ERROR: for mysql Cannot create container for service mysql: invalid volume specification
@spiderdev2010
@spiderdev2010 2 жыл бұрын
Dont know what the issue always showing nginx welcome page... Can you help me in that sir?
@muhammadnasser2735
@muhammadnasser2735 3 жыл бұрын
The Compose file './docker-compose.yml' is invalid because: Unsupported config option for services.mysql: 'try
@clydeortega3766
@clydeortega3766 3 жыл бұрын
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,
@alexios4392
@alexios4392 4 жыл бұрын
Do you have to have installed all packages like nginx, php, mysql before running docket or does it install it?
@andriisukhoi5672
@andriisukhoi5672 Жыл бұрын
Super! Thank you very much Sir!
@vladvasilov
@vladvasilov 4 жыл бұрын
Great tutorial! But unfortunately this type of configuration will run really slow...have any thoughts about this? Thanks
@chrisdedavid1860
@chrisdedavid1860 2 жыл бұрын
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.
@alexdorrington
@alexdorrington 2 жыл бұрын
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
@ibolt795
@ibolt795 3 жыл бұрын
Great video! "Additional property mysql is not allowed error "---- anyone else getting this?
@RolandoRamosTorres
@RolandoRamosTorres 9 ай бұрын
Great tutorial!!!! Thanks!!
@Thomas-ft6qs
@Thomas-ft6qs 2 жыл бұрын
Hi, I am wondering how to make docker do the migrations automatically when doing docker-compose up. Have you got an idea?
@parisanaderi1647
@parisanaderi1647 3 жыл бұрын
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?
@jacobward8851
@jacobward8851 4 жыл бұрын
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?
@aschmelyun
@aschmelyun 4 жыл бұрын
What's the output if you just run "docker-compose up nginx" without the -d flag or anything else?
@Nurhuda-xm9ek
@Nurhuda-xm9ek 4 жыл бұрын
if you use the Compose docker, can we use more than 1 program, or only for 1 program only?
@arshchoudhary5198
@arshchoudhary5198 4 жыл бұрын
Well done Andrew, I have a query how can we setup multiple laravel environment with docker?
@1337kaas
@1337kaas 3 жыл бұрын
What keyboard are you using? it sounds so satisfying :D
@kenjohnsiosan9707
@kenjohnsiosan9707 4 жыл бұрын
Hi Sir, my nginx container is not running but mysql and php containers does successfully...where i am possibly wrong? thanks
@binodmanandhar5318
@binodmanandhar5318 3 жыл бұрын
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.
@ievatenav
@ievatenav 3 жыл бұрын
Thanks! Really good and quick! :)
@shakirbaba3978
@shakirbaba3978 2 жыл бұрын
Hi, leva. Are you able to run laravel app using docker?
@soduno596
@soduno596 4 жыл бұрын
Thank you so much. You made me understand docker :)
@aschmelyun
@aschmelyun 4 жыл бұрын
Glad I could help!
@aimfreakify
@aimfreakify 4 жыл бұрын
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.
@rianasmaraputra
@rianasmaraputra 4 жыл бұрын
When i create laravel project on src folder, and access the url, i always got 404 Not Found. How can i fix this ? Thanks
@fraj1234
@fraj1234 4 жыл бұрын
Define working_dir: /var/www/html in nginx and php services
@quangminhpham1817
@quangminhpham1817 2 жыл бұрын
amazing course
@miraclemaddymm3694
@miraclemaddymm3694 4 жыл бұрын
hello there i am facing an issue which is the site cannot be reached...my nginx is running but other things not showing
@AlejandroDeLuca
@AlejandroDeLuca 3 жыл бұрын
Great explanation. Thanks!
@bernardchisumo4054
@bernardchisumo4054 3 жыл бұрын
could you set up Docker for multiple projects?
@skipydie
@skipydie 11 ай бұрын
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
@aschmelyun
@aschmelyun 10 ай бұрын
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.
@81gamer81
@81gamer81 4 жыл бұрын
Been annoyed with wamp for so long. MS nailed it with blocking my hosts file evry so often these days. Hopefully this will work
@persoulrpg
@persoulrpg 4 жыл бұрын
Hi, thanks for the video. Does docker-compose run mysql_secure_installation implicitly? Because I haven't seen you doing it.
@azzamjiul
@azzamjiul 2 жыл бұрын
This video is awesome!
@gjvidz
@gjvidz 4 жыл бұрын
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?
@aschmelyun
@aschmelyun 4 жыл бұрын
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!
@gjvidz
@gjvidz 4 жыл бұрын
Andrew Schmelyun thanks for the reply Andrew! Will definitely check it out.
@deolhonaboia-pescaria
@deolhonaboia-pescaria 4 жыл бұрын
Thanks so much! Saved my life!
@valentindobrica9584
@valentindobrica9584 3 жыл бұрын
Hey brother is there any way to automatize the database on laravel to run the migrations automatically on docker-compose build ?
@miguelstevens3042
@miguelstevens3042 5 жыл бұрын
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?
@Scratch924
@Scratch924 3 жыл бұрын
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; }
@JeeteshNariya
@JeeteshNariya 4 жыл бұрын
I don't want to use a composer in the local environment , can we use composer ras service or images?
A much better local Laravel dev environment with Docker
10:25
Andrew Schmelyun
Рет қаралды 57 М.
Laravel with Docker
18:27
Scrypster
Рет қаралды 105 М.
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 4,2 МЛН
PRANK😂 rate Mark’s kick 1-10 🤕
00:14
Diana Belitskay
Рет қаралды 7 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 1,2 МЛН
If you're not developing with this, you're wasting your time
14:30
Articulated Robotics
Рет қаралды 303 М.
Why is Laravel NOT used in Big Development Projects?
11:53
Stefan Mischook
Рет қаралды 182 М.
Build a solid WordPress dev environment with Docker
25:16
Andrew Schmelyun
Рет қаралды 79 М.
You don't need a frontend framework
15:45
Andrew Schmelyun
Рет қаралды 131 М.
Easily deploy a Laravel application with Docker
21:21
Andrew Schmelyun
Рет қаралды 90 М.
Running multiple Laravel apps locally with Docker
13:20
Andrew Schmelyun
Рет қаралды 38 М.
Running Scheduled Laravel Tasks with Docker
16:55
Andrew Schmelyun
Рет қаралды 21 М.
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 4,2 МЛН