Easily deploy a Laravel application with Docker

Поділитися
Вставка
  • Опубліковано 19 сер 2024
  • Want to learn more about how to develop and deploy Laravel applications with Docker? I've released a premium course featuring 23 videos for just $29! Check it out here: laraveldocker.com
    Alternatively, you can join as a member and receive that course, along with any others I release in the future, for free: www.youtube.co...
    In this 21 minute video, I'll show you how to easily deploy a Laravel application using Docker and two separate methods to get source files on a server.
    Join my weekly newsletter for tips on Laravel + more: aschmelyun.sub...
    Docker installation tutorial for Ubuntu 18.04: www.digitaloce...
    Docker Compose install tutorial for Ubuntu 18.04: www.digitaloce...
    You'll learn how to:
    - Set up Docker and Docker Compose on a remote Ubuntu server
    - Send files to a server using rsync
    - Use git and GitHub to commit, push, and pull files to a remote server
    - Run docker-compose on the remote server to deploy your app
    Follow me on Twitter! / aschmelyun
    Thanks Patreon supporters!
    - Sam Ross
    - PK
    - Melissa Kipp
    Directly support these videos @ / aschmelyun

КОМЕНТАРІ • 102

  • @martins-ecke
    @martins-ecke 5 місяців тому +1

    Still a Premium Course in 2024 - I bought the course recently, worked through it and am VERY happy that I did:
    Everything it teaches is still valid, you will learn the basics and how to become comfortable with hosting/running your Laravel App through Docker.
    Thank you for making awesome content Andrew 👍👍👍

  • @latlov
    @latlov 4 роки тому +20

    1:35 $ cp docker-compose.yml docker-compose.prod.yml
    1:38 Adjust the nginx port to 80:80
    1:47 Harden mysql passwords!
    4:05 Deployment options: 4:20 rsync
    8:19 Just after you've uploaded your Laravel project to the src/ folder ... However you wanted to (rsync, git, ftp, shell, putty, cmder, bitwise, etc)
    9:06 $ docker-compose -f docker-compose.prod.yml up -d --build
    9:30 how to add the laravel user to the docker group
    10:23 Update the Laravel's .env file for database credentials, app domain, etc.
    11:10 Run the migrations with $ docker-compose run --rm artisan migrate
    14:40 Deploy with git
    17:45 Cloning Laravel project into the src/ folder
    18:09 Editing .env file
    19:10 Run composer install: $ docker-compose run --rm composer install
    19:23 $ docker-compose run --rm artisan migrate
    19:33 $ docker-compose run --rm artisan db:seed
    20:43 : Everybody wondering ... where is the domain setup, SSL let's encrypt, Redis, memcached, supervisor, ... part ?

  • @flipperiflop
    @flipperiflop 4 роки тому +27

    Would be nice to see a production-grade docker/kubernetes config, with some settings that are secured and optimized - or just some info of how to do it wrong in a production setup, and what kind of things to keep in mind - like for example having ports open only internally, or settings to make sure opcache is set properly.

  • @mcvgs1780
    @mcvgs1780 3 роки тому +2

    For someone like me who has been itching to deploy my laravel projects your content has been a really good source of info.

  • @Arcwise
    @Arcwise 3 роки тому +3

    These Laravel Docker videos have been a lifesaver for me. I'm happily buying your course, thank you!

  • @muhohojeremy4861
    @muhohojeremy4861 Рік тому +1

    I love this, the kind of learning I salute like teaching from 0 to production. ❤.

  • @ochienoeliud5723
    @ochienoeliud5723 Рік тому +1

    Very informative indeed! Clarity in your step-by-step flow makes the learning process easy to understand. I can now swiftly get my laravel projects to live env. Thanks alot Andrew🙏

  • @FaizanAnwerAli
    @FaizanAnwerAli 4 роки тому +34

    You missed few things for complex projects.
    1.) Deploy to actual domain.
    2.) SSL for that domain.
    3.) Socket connection.
    4.) Using SSL with socket connection.
    5.) Redis
    6.) Memcached
    7.) Digital ocean Spaces for reliable storage.
    8.) MySQL data will be lost once you bring docker down, how to solve that?
    I'm hoping part 2 to cover these problems.

    • @aschmelyun
      @aschmelyun  4 роки тому +28

      This was definitely just an introductory video, additional parts covering those items will be coming up!

    • @vaibhavdeokar7642
      @vaibhavdeokar7642 4 роки тому +1

      It would be great to see that info.....

    • @jaysonvacaro9345
      @jaysonvacaro9345 4 роки тому +3

      @@aschmelyun Looking forward to this. Nice tutorial though

    • @izclubcom
      @izclubcom 4 роки тому

      Great. Im waiting comming soon

    • @leejenn4779
      @leejenn4779 3 роки тому

      Hopefully can have a video to cover these.

  • @rkd-me
    @rkd-me 4 роки тому +9

    Andrew, cannot thank you enough!
    I have been playing recently with docker and your videos are the best, once again thank you and keep it up!
    BTW. do you consider any tutorials for Kubernetes?

  • @rudeadyet1992
    @rudeadyet1992 4 роки тому +4

    Thank you very much! Waiting for CI/CD bitbucket or GitLab pipelines for docker deploy! :D

  • @oussamafahchouch6871
    @oussamafahchouch6871 Рік тому

    Thanks for the nice tutorial about how to easily deploy a laravel app with docker!

  • @JohnnyBigodes
    @JohnnyBigodes 4 роки тому +1

    This was the video I was waiting for... It is great... Thank you for this...

  • @k0mar12
    @k0mar12 3 роки тому

    That what i'm talking about, i have been spent so much time for looking great tutorial. Thank u so much

  • @latlov
    @latlov 4 роки тому +9

    Thank you, Andrew! How about adding Let's Encrypt and domain? Or have already uploaded a video about it?

  • @bobbyiliev_
    @bobbyiliev_ 3 роки тому

    Cool to see my own answer on the DigitalOcean forum in the video 🎉

  • @DivDax
    @DivDax Рік тому

    Great explanation! Keep up the good work! 🙏

  • @christostsangaris4785
    @christostsangaris4785 2 роки тому

    Dude this is amazing! Great resource!

  • @MarcelloPato
    @MarcelloPato 3 роки тому +1

    Hi Andrew!
    Could you please make a video on how to build an image from production so I can push that to a repository?

  • @fernandocueto5652
    @fernandocueto5652 20 днів тому

    Man, awesome tutorial. Thank you. I'm following every step you take, however, when I try to instal dependencies with composer I get this:
    In Filesystem.php line 260:
    /var/www/html/vendor does not exist and could not be created
    What am I doing wrong?

  • @AirCode7
    @AirCode7 Рік тому

    is there still this repo link, i love that you handled the composer and artisan containers, one thing that would change its that instead use nginx of server it self as service, if you have multiable sites

  • @bhaidar
    @bhaidar 2 роки тому +1

    Hey Andrew, can you share how to deploy Laravel+Vue in a single docker file? Thanks

  • @ejay4032
    @ejay4032 3 роки тому

    Thanks!!! This was extremely helpful

  • @levitica2017
    @levitica2017 Рік тому

    So clear! Thank you

  • @einfacherkerl3279
    @einfacherkerl3279 Місяць тому

    when you were typing commands at the bottom of the screen, i just want to tell you. I could still see them, next time to be sure to hide whatever you are typing because people might learn what you are typing.

  • @tecsmith_info
    @tecsmith_info 4 роки тому

    Excellent tutorial, very well done.

  • @LostinTheTube
    @LostinTheTube 4 роки тому +1

    Great tutorial!

  • @chanakakasun7843
    @chanakakasun7843 2 роки тому

    Andrew, can you maka a video for file uploading in laravel within docker container.It is hard to understand how to view uploaded files and how to create symlink correctly.If you can make a videos it is helpfull

  • @paulisaris
    @paulisaris 4 роки тому

    Awesome tutorial, thanks!!

  • @codeursjuniors9043
    @codeursjuniors9043 Місяць тому

    where do you see the database ? on local ?

  • @ahmedhdeawy
    @ahmedhdeawy 4 роки тому

    Thank you so much for this video

  • @Hhtesh
    @Hhtesh 3 роки тому

    I have a question about the database.
    What is we want to move site to different server with existing database ?

  • @rajivguptaggs
    @rajivguptaggs 4 роки тому

    Wonderful thanks mate.

  • @axay_gadekar
    @axay_gadekar 4 роки тому

    Awesome.. just what i wanted.

  • @amrullahdev8895
    @amrullahdev8895 2 роки тому

    wait , so we dont have to make the laravel ,nginx , mysql as an image , and push to docker hub , then pull to the server to automacly run ? , just like put on github , pull on vps server , then do the rebuild like on the local ??

  • @ultimate-z
    @ultimate-z 2 роки тому

    Hey there, that would be very kind of you if you share docker-compose file.

  • @armiiiin
    @armiiiin 2 роки тому

    Great Video!

  • @VishalRana-ix9ry
    @VishalRana-ix9ry 2 роки тому

    I want to do this but with Ubuntu as core image then nginx and php on it which run the container need help

  • @zayediffadmahdi4194
    @zayediffadmahdi4194 4 роки тому

    can you make video using OS Ubuntu server in aws, and make deploy laravel app, nginx, and mysql in docker

  • @sospeterwangai8278
    @sospeterwangai8278 4 роки тому

    Hello, when running docker-compose locally is doesn't set laravel sessions, also the cookies can't be set. The only cookie available is the code editor's (phpstorm). What would be the issue

  • @swangiful
    @swangiful 4 роки тому

    Excellent stuff!

  • @SniperTunisian2011
    @SniperTunisian2011 4 роки тому

    What about having .env file that contains containers exposed ports for both dev and prod environments?

  • @gyana111
    @gyana111 2 роки тому

    Thank you

  • @ckwcfm
    @ckwcfm Рік тому

    Any chances you can do a same video but using docker swarm?

  • @alexios4392
    @alexios4392 4 роки тому

    How to automically do migrations with Docker?

  • @jordanalbarracin3119
    @jordanalbarracin3119 3 роки тому

    Hello, in the course you are selling you have to make a reverse proxy to store several laravel applications on the same server, that is, with Docker?

  • @hkhdev95
    @hkhdev95 Місяць тому

    Perfect

  • @kamleshpaul414
    @kamleshpaul414 4 роки тому

    i need to install puppeteer as welll

  • @timfranklin4724
    @timfranklin4724 2 роки тому

    Where can I find your docker-compose file?

  • @simonangatia2398
    @simonangatia2398 Рік тому

    11:29 docker-compose run --rm artisan migrate throws an error: ERROR: no such service: artisan

    • @jetzemeilink
      @jetzemeilink Місяць тому

      In my case I had to use the name of the service you declared in the docker compose file so laravel.test or the container id. So the entire command looked like this: docker exec php artisan migrate

  • @memack101
    @memack101 4 роки тому

    Thanks man

  • @josmardelposo7543
    @josmardelposo7543 10 місяців тому

    Github repository please!

  • @ammlyf
    @ammlyf 3 роки тому

    Thanks

  • @yuniorespinal9926
    @yuniorespinal9926 4 роки тому

    Awesome thanks

  • @maksymdudyk1718
    @maksymdudyk1718 3 роки тому

    How awesome!

  • @mangasprai
    @mangasprai 3 роки тому +1

    "easily"... looks pretty hard to me

  • @victorchinonsougwu1359
    @victorchinonsougwu1359 2 роки тому

    Thank you Andrew for this, but for deploying to server can git-ftp work for that??

    • @aschmelyun
      @aschmelyun  2 роки тому +1

      I'm pretty sure you can use git-ftp, I'll have to look into it deeper though!

  • @Defelper
    @Defelper 2 роки тому

    Can you show us how we can deploy with heroku?

    • @aschmelyun
      @aschmelyun  2 роки тому +1

      Sure thing! It's a bit of a different process, but I'd be happy to try and show it off in a future video.

  • @DaniSpeh
    @DaniSpeh 4 роки тому

    NIce, but one app on one droplet is a waste of money and resources, imo. A multi-app solution would be nice (inc. DNS, reverse-proxy ?)

  • @mdickymahfudin7201
    @mdickymahfudin7201 4 роки тому

    Hi, how to laravel schedule:run in docker?

    • @aschmelyun
      @aschmelyun  4 роки тому

      You could create a cron job on the server to run docker-compose run --rm artisan schedule:run every minute and it should give you the same outcome.
      I'll make a note of this use case and create a follow-up video in the near future.

  • @axay_gadekar
    @axay_gadekar 4 роки тому

    You could just setup bare git repo on server so we don't need to pull every time..

    • @aschmelyun
      @aschmelyun  4 роки тому +1

      Definitely! For anyone interested in that, this guide is super helpful for setting up hooks on a server: hackernoon.com/deploy-website-to-remote-server-using-git-da6048805637

  • @meilyandevriyantimor5492
    @meilyandevriyantimor5492 4 роки тому

    Hi, @Andrew Schmelyun. Can you make a video that deploys the Laravel app using Nginx and PHP-fpm in one Dockerfile and MySQL to another Dockerfile in the production environment? I had been researching about it and tried to make my own Dockerfile, but wanna see from your perspective and your opinion. Nice video

    • @vaibhavdeokar7642
      @vaibhavdeokar7642 4 роки тому

      Can you pass on that setting I am also working on that
      Like repo link

  • @vaibhavdeokar7642
    @vaibhavdeokar7642 4 роки тому

    Sir I have a question
    If we do docker down then it will shut down the container the what happens to the database ?

    • @latlov
      @latlov 4 роки тому

      If there are no volumes, database info is gone.

    • @arsaphone
      @arsaphone 3 роки тому

      @@latlov use volume

  • @alexfury8755
    @alexfury8755 3 роки тому

    Amazing

  • @cultureofnepal2024
    @cultureofnepal2024 4 роки тому

    Hi Andrew, can you make this system with tools using deployer or capistrano or using github actions.

    • @aschmelyun
      @aschmelyun  4 роки тому +2

      That's coming soon! I'll be doing a whole video on deploying with Docker and CI/CD systems.

    • @cultureofnepal2024
      @cultureofnepal2024 4 роки тому

      @@aschmelyun thanks andrew.

    • @cultureofnepal2024
      @cultureofnepal2024 4 роки тому

      Is it possible to make this repository public?

  • @TheDesvendador
    @TheDesvendador 4 роки тому

    your editor is phpstorm? if so, which theme is that?

    • @aschmelyun
      @aschmelyun  4 роки тому +1

      Yes, it's PHPStorm! And the theme I am using is called Material Theme UI with the Atom One Dark color scheme.

  • @subhrajit372
    @subhrajit372 4 роки тому

    hi, i am building a website with laravel, it implements video calling and chatting, and to use socket.io i have to use node server in my project, but i am confused about how to deploy the project in a platform like aws or digital ocean?

  • @satheshkumar5906
    @satheshkumar5906 3 роки тому

    useful

  • @ojiepermana
    @ojiepermana 4 роки тому

    deploy with kubernetes please 😀

  • @HakkiKonu
    @HakkiKonu Рік тому

    do not use rsync in your professional work life. instead learn ci/cd workflow

  • @veoquenoesunproblema
    @veoquenoesunproblema 3 роки тому

    Thanks for the video but it didn't work at all anything of what you have done. I literally follow your first video and this second video and nothing.

  • @murphishouse
    @murphishouse 2 роки тому

    Github repository please!