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

Комментарии • 51

  • @Vlabalala
    @Vlabalala 23 дня назад

    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!

  • @adamolecky6296
    @adamolecky6296 Год назад +2

    Well, that is just some quality content. Easy follow through and working. I love it (after several hours of reading documentation this is heaven).

  • @Big_Dadaa
    @Big_Dadaa 2 года назад +1

    Thanks man, just finished watching the last video. Awesome work.

    • @TheCodeholic
      @TheCodeholic  2 года назад

      Happy to read such feedback. Thank you.

  • @mrbee1633
    @mrbee1633 2 года назад

    that's cool, appreciate your dedication

  • @CesarRodriguez-nb2lm
    @CesarRodriguez-nb2lm 2 года назад

    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

  • @zoezoem6233
    @zoezoem6233 9 месяцев назад +1

    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

    • @TheCodeholic
      @TheCodeholic  9 месяцев назад +1

      Your comment is so awesome.. Thanks a lot my friend.

  • @devanochi3073
    @devanochi3073 2 года назад +1

    Also the meme clips that you add to the edit are so funny , sarcasm is a powerful tool .

  • @AbdelghaniGUILIGHE
    @AbdelghaniGUILIGHE Год назад +1

    Thank you so much, keep up the good work

  • @fbb3006
    @fbb3006 2 года назад +2

    Good idea!

  • @vietthinh209
    @vietthinh209 2 года назад +1

    amazing!

  • @beticohernandez9536
    @beticohernandez9536 Год назад +2

    It is interesting to start building your framework

    • @TheCodeholic
      @TheCodeholic  Год назад

      Go for it.
      I think you will learn a lot.

  • @arashpirhadi1326
    @arashpirhadi1326 2 года назад +1

    very usefull 👍

  • @devanii
    @devanii 2 года назад +1

    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?

  • @luckyboy9339
    @luckyboy9339 2 года назад

    Thank you.

  • @pooyasadeghi7551
    @pooyasadeghi7551 Год назад +1

    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?

    • @TheCodeholic
      @TheCodeholic  Год назад +1

      I have a video on exactly that topic. Please check PHP MVC Framework playlist.

  • @rpbale
    @rpbale 27 дней назад

    Great video. It would be cool if you did a video on moving your container to a Google Cloud VM

  • @globalruckus2174
    @globalruckus2174 10 месяцев назад

    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.

  • @jacklarmany
    @jacklarmany 2 года назад +1

    Sir..! Could you make a video yii2 RBAC step by step.

  • @olamidefalowo1407
    @olamidefalowo1407 Год назад

    will this method work if i use codeigniter 3 and posgresql 13?

  • @b4rt1j1
    @b4rt1j1 2 года назад

    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

  • @nick4bizz42
    @nick4bizz42 Год назад

    Can this work with yii2 application? its been bugging me for a while.

  • @alykhanabdulkahil
    @alykhanabdulkahil 2 года назад +1

    iloveyou sir.

    • @vaja5357
      @vaja5357 2 года назад

      I was getting suspicious.

  • @devanii
    @devanii 2 года назад

    for some reason it wont change document root

  • @Saboor-Hamedi
    @Saboor-Hamedi Год назад

    Can someone please help me, I have got this error:
    Connection failed: SQLSTATE[HY000] [2002] Connection refused

  • @AliHassan-wc6nb
    @AliHassan-wc6nb 2 года назад

    Champ! Just want to know how to implement multithreading in Php and perform Long running jobs. Preferably in yii2.

    • @TheCodeholic
      @TheCodeholic  2 года назад

      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).

    • @AliHassan-wc6nb
      @AliHassan-wc6nb 2 года назад +1

      @@TheCodeholic thanks bro! that I have done already using scheduler thanks champ! It always worderful to get your response! Lot of Respect for you!

    • @AliHassan-wc6nb
      @AliHassan-wc6nb 2 года назад +1

      Pleas try to make a video on "Fibers" in php 8.1. How to use this.

    • @TheCodeholic
      @TheCodeholic  2 года назад +1

      @@AliHassan-wc6nb at the moment I have plans for at least next 10 videos, we'll see in the future

    • @AliHassan-wc6nb
      @AliHassan-wc6nb 2 года назад

      @@TheCodeholic I will wait till these 10 videos! Lol.

  • @AtomTCP
    @AtomTCP 8 месяцев назад

    what about htaccess

  • @devanochi3073
    @devanochi3073 2 года назад

    Can you make docker linux setup video !

    • @TheCodeholic
      @TheCodeholic  2 года назад +1

      Yes I can, but there are already many videos on that topic

  • @awwtawnoo
    @awwtawnoo 2 года назад +1

    VSCode theme ?

  • @BobDoe_69
    @BobDoe_69 2 года назад

    please tell me you have phpmyadmin in this too !

    • @TheCodeholic
      @TheCodeholic  2 года назад

      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..

  • @beticohernandez9536
    @beticohernandez9536 Год назад

    Ok.

  • @vaja5357
    @vaja5357 2 года назад

    ამის მერე ვისზე ნაკლებიღა იქნება ჩვენი frameworkი?!

    • @TheCodeholic
      @TheCodeholic  2 года назад

      😀 დავაი გავყიდოთ

  • @NargisGasimli-qb1qv
    @NargisGasimli-qb1qv 5 месяцев назад

    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? :(

  • @theRajib1985
    @theRajib1985 2 года назад +1

    very usefull 👍