PHP Docker Tutorial - Nginx - PHPFPM VS Apache - Full PHP 8 Tutorial

Поділитися
Вставка
  • Опубліковано 28 лис 2024

КОМЕНТАРІ • 339

  • @cw1847
    @cw1847 3 роки тому +75

    Gio, you are an awesome teacher. This whole course is GOLD. Thank you.

  • @bracoyote96
    @bracoyote96 Рік тому +9

    Many times I've tried and failed to understand what docker is. Now I have a basic but solid idea of what it is thanks to a PHP guide. Wasn't expecting that but thank you very much ^^

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

      That is super awesome, really happy to hear that

  • @abrahamnalisi4648
    @abrahamnalisi4648 Рік тому +5

    I love how you explained Docker and its configuration. I've been trying to understand it for months but your content made me unify everything I read before and even get a project up and running within docker. I'm a seasoned PHP dev and I'm enjoying re-learning from your course coz its making me understand 'newer' concepts and expanding my thinking. Thanks Gio!

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

      Super happy to hear this, thank you & good job

  • @isaacsouza17
    @isaacsouza17 3 роки тому +10

    Once you use docker (and get over the first headaches) you will never want go back to thing like XAMPP, docker, and specially docker-compose, are great for local development, even more for people who use Linux, in which docker runs at lightspeed.
    Thanks for the tutorial, great video, keep it up.

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

      Thank you. I agree 💯. I haven't used anything else since I started using Docker.

  • @rodolphe8859
    @rodolphe8859 Рік тому +9

    That 's a proper course.Every learning program should be like that.Learning the right syntaxe, the right architecture and the right way ;)

  • @snakemanluffy7645
    @snakemanluffy7645 3 роки тому +8

    wow, It's been a while. I stopped watching you cause there were no more PHP videos. Tnx I will finish again today. Will wait for another 8-10 videos to watch. Thank you for this amazing course. I want to let you know that I got the job that I was telling you about. It's a PHP/Laravel Job. I have learnt so much from you about PHP. Thank you. I will be grateful forever :)

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

      That's amazing. Im happy to hear that my videos were & are helpful. Thank you 🙏

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

      @@ProgramWithGio This is an error i get got when i did docker-compose up, kindly assist services.app.build must be a string

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

      @@omegajunior8963 DM me on Twitter and I'll help you troubleshoot it. If you can share your Dockerfile & docker-compose that will be better

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

      @@ProgramWithGio I have been able to solved it. i didnt type the codes well. Thank you very much. I am enjoy this course by the time i get to video 70 i will be able write a complete program. you are blessing me

  • @mdzahid1389
    @mdzahid1389 8 місяців тому

    Many times I've tried and failed to understand what docker is. Now I have a basic but solid idea of what it is thanks to a PHP guide.

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

    Even after 2 years of publishing the course, I managed to ask my questions and get my problems solved via twitter and discord. I mean it is not sth u get with ANY FREE COURSE out there. I just want to say Im rly grateful...

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

    I know everyone already told you how good of a teacher you are. BUT i gonna say it again , YOU ARE A GREAT TEACHER , glad i found you. Thanks for theentire playlist.

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

    PHP needs courses like this!
    PHP is the king of bad learning videos and low quality infos, and I don't know actually why. So many awful code practices everywhere, so many anti-patterns (with globals, without composer, without namespaces, with mixing buisness logic with presentation layer, with only one file functions.php "for everything", etc.). This is not my first language and I see that these code practices are really bad and smelling, but many-many newbies may find it helpful...
    Gio, really thank you for such quality course. Only suggestions - please, give us more practical exercises.
    Keep up your awesome work!

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

      Thank you & thank you for the suggestion 🙌🙌

  • @ChandanSomani-r5o
    @ChandanSomani-r5o Місяць тому

    Loved the way you showed the way to configure docker & php ... just clear the missing information

  • @ryanford516
    @ryanford516 2 роки тому +5

    Thanks for the video, Gio! I had to take a lengthy Docker course before proceeding but I now see the utility of containerization, it's really cool.
    The only thing I still can't wrap my head around is data transfer between the server and PHP-FPM. So you've got 2 separate containers running, one with the PHP-FPM installed and the other with the server that doesn't automatically pass requests to .php files over to any interpreter. These containers essentially share one interface though, which is the src directory on the Docker host. Still I don't get the mechanics of this all. Suppose you initiate an HTTP request on your Docker host (via browser) and the destination is the loopback address with the 8000 port attached to it. The OS on the Docker host parses the request and since 8000 is the port one of our containers listens on, that container gets that request. This container is running Nginx and it sees that it's a request to a .php file. Okay, what next? In the config file it says "fastcgi_pass app:9000" so I understand that this is the part responsible for forwarding the request to the PHP interpreter. However, what does "app" stand for? Through deduction I conclude that's the reference to the container (service) running PHP-FPM but the name of that service is actually "programwith-gio" as indicated in the .yml file. So I'm confused.
    TL;DR: how does PHP-FPM communicate with Nginx when they're running in separate containers?

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

      Glad you took the additional course for the Docker, it does come in handy. So the 'app' is not the container name but the service name, if you check the docker-compose programwithgio-app is the container name but the service name right under services is app.

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

      ​@ProgramWithGio thank you, I'm almost finished with your truly awesome series, and I've also recommended it to my dev friends. Now I decided to backtrack some crucial things in your code that I still am not quite comfortable with in terms of understanding, however. Right now it's some of Nginx config blocks. I'd be grateful if you could point out the flaws in my logic here. So here goes.
      If you use an arbitrary endpoint to make a request to the app, e.g. localhost:8000/foo it's going to be handled by the second location block first. The request URI is /foo, and I assume that's what should be in the $query_string variable. However, the variable is empty as I checked it by sending a header with its contents back as a response via the add_header directive inside the second location block. So how does the request URI persist through to the point of being processed by index.php?

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

    Yay, I got Docker set up thanks to Mr. Gio!

  • @shaimaal-haimi2739
    @shaimaal-haimi2739 Рік тому

    شكرا لك جيو لقد كان الفصل الاول صعبا لكني سأواصل وسأقوم بأكمال جميع الفصول الى نهايتها انت الافضل

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

    Just found you, and man i can say your way of teaching makes it very easy to follow whats going on. Thank you, I'll be following your tutorial and subscribed.

  • @Vitalii-m6r
    @Vitalii-m6r Рік тому

    I like working with Docker as I use Windows. Thanks a lot!

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

    Awesome video as always, I wish all tutorials was this good.

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

    OMG, u r the GOAT, so helpful, loving Docker now

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

    really not a friend of php. Mostly writing in NodeJs. But this series is just amazing. Love it

  • @ollienicholson
    @ollienicholson 4 місяці тому +2

    @ 12:31 "Now the cool thing about whatever we did" 🤣🤣 so general, I love it

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

    Best course I've ever seen and learned from. Thank you for that GOLD

  • @edxkr2ym6atl66
    @edxkr2ym6atl66 2 місяці тому

    That pucture on 0:22 made my day))

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

    So useful videos with a friendly and one step up perspective! Thanks so much

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

    Great tutorial! Gio be making me feel like a pro👍

  • @rafaelmsalescom
    @rafaelmsalescom 7 місяців тому

    Really appreciate the course. This video in particular helped me a lot.
    Thank you very much Gio!

    • @abduabdu7404
      @abduabdu7404 6 місяців тому

      Sir, can you teach me how to download and setup docker compose and nginx the right way. i am a begginer and have been struggling with this for 3 days, i looked at many tutorials but they did not help.

    • @rafaelmsalescom
      @rafaelmsalescom 6 місяців тому

      What problems are you having?

    • @abduabdu7404
      @abduabdu7404 6 місяців тому

      @@rafaelmsalescom i am trying to setup and download the dockerfile, docker-compose.yml and nginx but i cannot figure it out

    • @abduabdu7404
      @abduabdu7404 6 місяців тому

      your help would be so greatly appreciated, as i have been trying to solve this for days

    • @rafaelmsalescom
      @rafaelmsalescom 6 місяців тому

      @@abduabdu7404 Following the video steps didn't work?

  • @goldfix8112
    @goldfix8112 2 місяці тому

    Yess. Ahh thats headache.. Starts from installing docker on ubuntu and continues with attempts to force it work, changing configurations that was in the video, sending energy in space and stuff like this. But now it works somehow! Almost understand how exactly. Thanks for work.

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

    Liked before watching

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

    Great tutorial, thank you so much.
    The working_dir doesn't need to be redefined in docker-compose file for app container.

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

      Thank you. That is correct, I just prefer to have it in both cases in case you only work with docker-compose.yml and abstract away the Dockerfile somewhere else. Just a habit I guess

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

    Thanks for your good teaching.
    This video was useful for me.

  • @KennedyMutua-yx3vs
    @KennedyMutua-yx3vs 6 місяців тому +1

    The latest and recommended version of the Compose file format is defined by the updated Compose Specification
    Those who might use this video,
    use “Docker compose up”
    And name your file “compose.yml” over "docker-compose.yml" even though backwards compatibility is kept
    And don’t pass a version header
    this is the updated way at time of writing

    • @abduabdu7404
      @abduabdu7404 6 місяців тому

      Sir, can you teach me how to download and setup docker compose and nginx the right way. i am a begginer and have been struggling with this for 3 days, i looked at many tutorials but they did not help.

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

    Thank you, great lessons.
    I have a suggestion:
    In new videos. If you please, make the File/ Settings/ Appearance & Behavior/ Appearance: use custom font size: 16, so the menus look a bit clearer. Also, Editor/ Color Scheme/ Cobalt, has a clearer contrast than Darcula when presenting code to others.
    Thank you again, and please keep on.

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

      Thank you and yes I agree. I'm going to increase the font, in later videos I started zooming in on important parts but increasing font should help. Will test the cobalt theme 👍

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

    Gio, I need your help. when i type docker-compose up in the terminal I get, "no configuration file provided: not found" I don't know what to do, I have tried everything I searched on Google except changing to linux. What should I do?

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

      cd into the directory that has the docker-compose.yml file and run the command from there

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

      @@ProgramWithGio Thank you so much man ❤you're undoubtely the best php teacher I've seen

  • @ernestogimeno646
    @ernestogimeno646 2 роки тому +2

    Awesome course so far. Sorry if you already mentioned but I can't find it. Do you have the source code posted somewhere? I find it specially useful to copypaste the configuration files and avoid typos.

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

      Thank you. Check description of the video, link to the source should be there

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

    Great. I need to watch it again so I can set docker up. I downloaded docker composer before but I don't know what went wrong. For one I didn't even know how to integrate with the any server and then I was also installing wsl2 and the whole thing made my computer so slow that I had to remove them all and technically re-install my OS. But from what you showed, it seems easy if I follow what you demonstrated (I hope).

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

      Fingers crossed, hopefully it works out this time 🤞

  • @BrettRoscoe-b6t
    @BrettRoscoe-b6t 8 місяців тому

    Like everyone else I'm also enjoying this series. I just had a couple of questions about the docker setup: (1) Why is the bind mount ("- ../src:/var/www") required for both the app and nginx services? Shouldn't it only be necessary for the app service? (2) Why is there a ".d" at the end of the nginx config path in the docker-compose.yml file? I've tried everything and it works great; I just don't understand how it works.

    • @ProgramWithGio
      @ProgramWithGio  7 місяців тому

      Thank you.
      1. nginx might need access to the source as well to serve static assets etc
      2. Its more like a convention

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

    My advice would be to leave your folder structure in git for others to copy cause writing by hand can lead to typos :D I don't understand all of the things in your docker files but i think that is normal, cause I only used XAMPP and I didn't need to write anything there. Last question would be why are we writing /var/www directories in a lot of places?

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

      My reply was removed by UA-cam. Not sure if you had the chance to see it. /var/www contains your source code in docker container but if you don't mount the volume it will just be empty. So we map the local source directory to the /var/www. Not understanding everything is perfectly normal, you'll learn along the way. If you like Docker I would suggest watching some docker tutorial and then a lot of things will make sense. You can DM me on twitter in case my reply gets deleted again if you have follow up questions. Idk what's up with UA-cam deleting my replies ☹️

  • @josuebarros-desenvolvedorw2490
    @josuebarros-desenvolvedorw2490 3 роки тому

    Thanks a lot for the wonderful video!
    I can see that I need to become good with Docker fast!

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

      You're welcome. It's not that bad once you play around with it.

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

    best tutorial ever

  • @sarc143
    @sarc143 11 місяців тому +1

    When i run docker-compose up it gives me an error that says : no configuration file provided: not found

    • @ProgramWithGio
      @ProgramWithGio  11 місяців тому +2

      cd into the directory that has the docker-compose file & run it there

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

    Thanks for the video man ✨

  • @ינוןאלבז-כ1ז
    @ינוןאלבז-כ1ז 2 роки тому

    great lesson!

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

    I'm done. My docker is up and running with all the other hassles inbtwn. Local Host is running now. Thanks a lot Gio. But if I close my text editor after the container is up will it still run? And if it doesn't still run how do I get it up again?

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

      That's great, good job. When you close the editor it doesn't stop containers. You need to run docker-compose down, if you want to start containers again just run docker-compose up -d

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

    best php course

  • @clivecorner
    @clivecorner 11 місяців тому

    HI there Gio. I have attempted to get nginx up and running with docker. But it's not worked for me somehow. It could just be a typo. Is there any chance of zipping up the docker directory and posting it to git hub. Many many many thanks for your great teaching.

    • @ProgramWithGio
      @ProgramWithGio  11 місяців тому +1

      You can just share your code repository that includes the Dockerfile & docker-compose as well as nginx configuration.
      Any specific errors you are facing? Try checking logs using docker logs command for nginx container

    • @clivecorner
      @clivecorner 11 місяців тому

      Will do@@ProgramWithGio

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

    Great video, thanks! I was wondering why we connect the src folder to both containers?

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

      One is for nginx & other is for php & php-fpm

  • @lairotuT-Tutorial
    @lairotuT-Tutorial 2 місяці тому

    Hi Gio, you are a great teacher!
    In this video however I want to give my constructive mentions. While for most this kind of product information seems to be normal and just informative, my brain plays games with me in such "close-to-advertisement" features. I recognize that you prefer these products and you not only mention the benefits and features in you really fantastic way but give me and many others a clear idea of what we can expect from these. Thats great and please don't change this attitude! But would you mind to include some sort of advanced environment recommendation in general?
    However that might be because I am not a professional programmer but for me environment means feeling comfortable with a (one) solution. That has not to be all-in-one but a one(solution/combination)-for-all(long) time. I don't want to switch there and there and lose time to feel comfortable with the one and the other setting if you know what I mean. Of course and you tell this often in this video it depends on what you are working on.
    In my Idea a perfect environment would be to have the possibility to:
    - develop in the same way as I test (same IDE, same functionalities)
    - test with exactly same conditions as they run in production
    - ideally have at least one production setting on my own responsibility with the possibility to adjust this to fit to comparable production settings and to enable Closed Beta Testing.
    As I like to have the final app to have two different versions "test" and "production". I would like to have this "test" at least to have the same opportunities as full production and full development. Wouldn't it make sense then to have the development environment be the same as the production environment? And if so, why should I always use Environment for my development where everyone's clear this is for development, not for production?
    What would you recommend to me? Especially if I prefer to use free/open source products?

    • @ProgramWithGio
      @ProgramWithGio  2 місяці тому

      Thank you. Docker is the best way to achieve what you described. I just covered the basics for it since this course is not about docker but if you want to learn more you could watch some advanced Docker courses.

    • @lairotuT-Tutorial
      @lairotuT-Tutorial 2 місяці тому

      @@ProgramWithGio Thanks!

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

    How did you get the files in the docker and the src directories? What command would you run?

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

      Not sure what you mean, I have all my source files on WSL & then open the directory from the code editor.

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

      @@ProgramWithGio I got it figured out. The only problem is when I run localhost:8000, I get 502. Bad Gateway. How do I fix this, please?

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

      most likely a configuration issue. I would need to see your code & configuration to be able to assist. You can DM me on Twitter (X) your github repo link@@DavidKwadwoArthur

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

      Sure. On it@@ProgramWithGio

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

    great vid! what settings are needed for deploying php in production using docker/docker-compose?

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

      Thank you. That is a topic that would need it's own video. I would not recommend using development settings in production.

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

    Hi, Jio. I'm using Xampp. Is there any need for using Docker to complete this series?

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

      You can keep using XAMPP if that's what you are comfortable with

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

    really good course!!

  • @Klinoklaz
    @Klinoklaz 9 місяців тому

    I feel like installing extensions in official php images is a lot of pain. Had to install php-redis, imagick, mysql pdo and their dependencies from like 5 different places. What's the advantage of official images, comparing to apt-ing out all the stuff in a bare linux image?

    • @ProgramWithGio
      @ProgramWithGio  8 місяців тому +1

      Main advantages are security, consistency & most of the stuff are pre-configured. Going manual means you may need to do the configuration.

    • @Klinoklaz
      @Klinoklaz 8 місяців тому

      @@ProgramWithGio Thank you for the answer. My main goal is to build a local dev environment quickly, and won't ship containers to production or testing yet, so that's not too bad. I think the configuration thing depends, the official image doesn't maintain extensions in one place or with one tool, and has permission issues sometime (too much security), both which I hardly encounter with an apt install

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

    Thanks a lot sir. I have a question, where can we find the php.ini file or the services that we installed via docker-compose.yml file like server directory etc?

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

      It's usually under: /usr/local/etc/php/conf.d directory within the container. You can create a custom php.ini within your docker folder where your docker-compose.yml is for example and then modify docker-compose.yml and add the following line:
      - ./local.ini:/usr/local/etc/php/conf.d/local.ini
      under the volumes section right under where you map the source directory to the /var/www
      Rebuild the containers and it should use your custom ini. Note that your custom ini does not have to be a full PHP.ini it can just contain the changes you want to make.

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

    Should we always redirect all requests to index file

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

      Its up to you, though its good practice to have a single entry to the application.

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

    Hello
    Thank you for the great course. I've been learning for a month or so, but I could not get the docker working. Every parameter is working fine but when I reach localhost:8000 it doesnt work. Can you help me plz? ofc I have modified some addresses in your files including ../src/

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

      Hello. For me to be able to help I need to see the code and some screenshots. Reach out to me on Twitter and send me your Dockerfile, docker-compose and screenshot of your code structure

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

    Thanks for the video

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

    wow ty aloot Gio u are t best ,i hope u make a video nginx enable https with dockerfile and php

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

    Hello and thanks for this tutorial. I am just learning Nginx. Do you have a video where laravel is used with docker and apache? Can you pls point me to it?

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

      Hey, not really, I have a video about Laravel Sail but that does not include apache.

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

    Hi Gio How are you? Hope you are well. Just a question, I'm new in docker. I install docker desktop, pull php and nginx image in my docker desktop, download your source code Open it VS code and run docker-compose up. it says no configuration file provided: not found, please help me?

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

      Hello. Where are you running docker compose up from? Cd into docker directory cause that's where the docker compose file is

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

      @@ProgramWithGio Thank you so much Sir, you just save my day.

    • @OmarAsem26
      @OmarAsem26 7 місяців тому

      ​@@mdsirazul9231 how did it work with you? i did all of that and got into the docker directory and ran the command docker-compose up and i'm getting this error: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory
      any help from you guys would be appreciated

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

    Thank you for your job!

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

    I would like to use docker. But on windows it works too slow. I've got problems with installation already. It downloads very slow. So thank you for advicing laragon

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

      Yup, use whatever works best for your environment

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

    I often hear about vanilla javascript, vanilla php, vanilla linux. what does the term vanilla mean ??

    • @ProgramWithGio
      @ProgramWithGio  9 місяців тому +1

      Means without frameworks/libraries, vanilla PHP is just plain PHP

  • @Flo-mz8ct
    @Flo-mz8ct Місяць тому

    I hope I can finish you php tutorial at some point and then your hopefully finished laravel tutorial.
    Atm I do a lot of python, data science / AI stuff, I just can't find the time :'(

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

    Hi Gio, can you recommend a good docker course for beginners? (short and synthesized like yours)

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

      Hello. Techworld with Nana is a good channel. She has a 3hr course on Docker I believe.

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

    Hi, these days I am trying to configure Xdebug inside the php composer. I'm following several tutorials but none of these are exhaustive and above all working ... Do you intend to dedicate a video on Xdebug? (in my case I use vscode as ide)

    • @ProgramWithGio
      @ProgramWithGio  2 роки тому +2

      That's in my list, hopefully I'll be able to get to it. We'll see.

  • @akhileshkumar-iu9uq
    @akhileshkumar-iu9uq 3 роки тому

    What are the technologies needed to build microservice with php

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

      That is a broad question :). Depends on the application & goals/needs

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

    Great video Gio! Could you do a short one with xdebug capability inside the container some time please?

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

      Thank you. I have xdebug video planned, hopefully I'll get to it soon

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

    0:27... "And that's how docker was born" 😂

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

    why nginx service not have a build context like app services?

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

    Sir, can we follow the course on XAMPP, by not using Docker ?

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

    Hello, Teacher Geo, I hope you can help me. “I have Windows 7 and I cannot install Windows 10-11 because my device is weak. I downloaded and installed dockertoolbox and downloaded the container images nginx, alpine, php, redis, but when I do the docker-compose up command in vcod, an error appears even though I wrote The file docker-compose.yml & nginx.conf & dockerfile correctly, so I decided to move to larvel homestead. What do you think of it? Will I be able to create an online store with it and transfer it to Hostinger hosting without problems? If you have another suggestion, let me know.”

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

      For local development it's fine, you can try Laragon as well

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

      That is, when I upload the site to hosting, there will be no errors and it will work well. I plan to build an online store with Larvel and React. It will not crash and will work well if I built it with Laragon.

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

      Not sure if Laragon is meant for production, its just a local development environment. For production you can use something like Digital Ocean & if you need help provisioning, you can use Laravel Forge.

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

      ok, thank you

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

    Is this episode considered advanced level ? I do not understand most of it , Should I watch it more than one?

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

      This is considered intermediate, Section 1 is basic, Section 2 OOP (intermediate), Section 3 Advanced. Docker is not a requirement, its just an alternative to XAMPP, feel free to keep using XAMPP or Laragon depending on what you are currently using. You can come back to Docker later.

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

      @@ProgramWithGio got it 😁

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

    was my comment deleted?
    with me comes an error and was after I enter docker-compose up comes the error
    ERROR: The Compose file '.\docker-compose.yml' is invalid because:
    'nginx' does not match any of the regexes: '^x-'

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

      UA-cam sometimes removes comments if it thinks it's a spam. Looks like an error in docker-compose. Compare it to my file and see the difference.

  • @AmitGupta-cc9fk
    @AmitGupta-cc9fk 8 місяців тому

    Sir, I have a problem, Docker is running fine but unable to access localhost:8000, please advice.

    • @ProgramWithGio
      @ProgramWithGio  8 місяців тому

      Check docker logs and confirm both nginx & fpm container are running

    • @adamw6893
      @adamw6893 29 днів тому

      I had this problem too - make sure the nginx.conf root and docker-compose volumes use the same location, they should both be /var/www. The nginx.conf was incorrectly set to var/www/public

  • @Sasha-li2bn
    @Sasha-li2bn 2 роки тому +1

    Hi Gio, I''ve tripple checked the code and it seems to be the same as yours. Running docker-compose up in terminal was a success and now when I go to localhost:8000 I get a 404 not found /nginx message which is good I guess because I got the containers running but I can't execute anything from index.php.
    Any idea what might be the problem?
    (Just localhost doesn't work at all unless XAMP is on which makes sense to me..:D)
    I get this in my terminal everytime I try to connect:
    | 172.18.0.1 - - [10/Jan/2022:17:30:57 +0000] "GET / HTTP/1.1" 404 556 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gec
    ko) Chrome/97.0.4692.71 Safari/537.36"

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

      Can you share the nginx.conf & docker-compose as well as Docker file screenshots? You can send them on Twitter if you want and I can take a look.

    • @Sasha-li2bn
      @Sasha-li2bn 2 роки тому

      @@ProgramWithGio Sent!

    • @Sasha-li2bn
      @Sasha-li2bn 2 роки тому +1

      SOLVED VIA TWITTER: My Index.php was located in the SRC folder only. I did not have it in the PUBLIC folder and the nginx config points to the PUBLIC folder.

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

      @@Sasha-li2bn Same issue, add a public folder. src/public/index.php 🌸

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

    Would be cool to know how to use cdn with apache, everywhere I look for this there's "that's a topic for another video" but pretty much every server I work with have apache not nginx.

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

      Whenever I say "that's topic for another video", I actually cover it in another video. I can't fit everything into one video, otherwise it would be a giant video. We used Apache in the beginning of the series & since this series is all about learning PHP "the right way" it was important to cover some alternatives to apache, so I decided to cover nginx in second section.
      We are going to work on a final project at the end of the series & deploy it. I plan on setting up CDN as well there and that's probably where I'll talk about CDN.

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

    Hi Gio how are you? just a question, is it necessary to have a dockerfile for each image before using docker compose? because i tried, i have a dockerfile for php, nginx and mysql, but the nginx container keeps restarting all the time, and now i saw that you didn't create the nginx dockerfile. Thanks in advance! and sorry if i hadn't smashed the like button on all your videos, they're like drugs and i don't even realize when i'm in a new one :( lol

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

      Hey, I'm good, thank you. How are you?
      You need some sort of base image, you dont need to have separate Dockerfiles, can just use the existing images for MySQL for example.
      If you share your code I can help troubleshoot it. Put it up in GitHub and send me the link in Twitter as well as screenshot of the issue.

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

    I did not quite understand why there are two seperate containers for the application and for the apache daemon. If i understand the .yml file correctly, the whole project will be mounted into the nginx container and the nginx deamon will process all the requests. And also the whole project will be mounted in the app container. Since the nginx container will not access files from the nginx container, I don't understand whats the purpose of the app container in the first place.
    Thanks in advance ! :)

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

      Don't forget about fpm, nginx is just webserver

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

    any idea how to increate the memory limit of this ?. because I cannot find the php.ini in your tutorial...how to set that in docker?

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

      You will need to create php.ini in docker directory for example & copy it over from either Dockerfile or docker-compose. Google "custom php.ini docker-compose"

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

    I've downloaded github repo, but not working... 502 bad gateway error... can you help me?

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

      Sure, ping me on Twitter and I can help troubleshoot the issue

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

    When developing in docker, how do you autoreload your browser on filechanges ?

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

      You mean hot reload? I have not set that up with Docker, so I'm not sure to be honest.

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

      @@ProgramWithGio yes I meant hotreload, smashing F5 is not elegant :D
      btw your response time is awesome.
      A rough workaround could be adding header("Refresh:1"), so the page refreshes itself. Can be problematic at some point I guess.

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

      @@drgregoryhouse1470 Vite has that built in I think for front-end, so you could give it a try. Yea adding refresh every second isn't that good, will become annoying very fast 😁

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

    Can I use php in-built server on php-fpm in docker without using Nginx as server?

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

      I'm not sure to be honest, I have not used php's built-in server.

  • @maxwell.6374
    @maxwell.6374 2 роки тому

    Hi, can you explain how to run code from GitHub and connect everything to Docker in Windows? I tried docker-compose up in terminal, but all I get is error "no configuration file found".
    I'm thinking that maybe workdir isn't correct, but I don't know to what I need to change it to work.
    Thanks in advance!

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

      You need to execute docker-compose command where the docker-compose.yml is in. So cd in that directory and the run docker compose command

    • @maxwell.6374
      @maxwell.6374 2 роки тому +1

      @@ProgramWithGio Thank you! That was really helpful, now I can proceed following this amazing tutorial.

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

    Hello first of all, thank you for all this courses.
    My question is about the docker, with xamp you show how to configure but with docker I try since 2 days but I am so lost.

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

      Hello. I also show how to configure with Docker. Any specific errors/issues you are having?

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

      @@ProgramWithGio after 5:42 minutes I cannot follow because I dont know how did you put the docker and src on the code editor.
      What condiguration you do on the doxker logiciel?

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

      @@veyspixelboy there are two ways you can do it. One is have your source code on your computer C drive or whatever drive, doesn't matter, and open it in editor that way. Another way is to put your source code to WSL distribution and you should be able to open that from editor as well. Having source files in WSL is better because it is faster due to less disk IO. You can try the other way first.
      Also I would recommend watching docker for beginners tutorial if you want to use Docker. If it's too much then I would just stick with XAMPP or Laragon, it doesn't matter what you use locally, use whatever makes you productive. Docker is not a requirement, I am just showing it as an alternative because we already covered XAMPP.

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

      @@ProgramWithGio okei thank you so much, I wanted just follow like 100%, I am so happy of your work Thank you again

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

      @@veyspixelboy no problem, good luck & thank you for following along 🙏💙

  •  2 роки тому

    Good video... thanks for your work. have you looked at the dddev project on this topic? For local projects I love ddev because it is Docker based and comes with some nice options and great features. This project is made for php developers like us…maybe another interesting idea for a short video?

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

      Thank you. No, I have not looked at ddev project, thanks for the suggestion

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

    Sir how can we install php nginx with docker in windows 10 as you did in Linux?

  • @leenalsous3
    @leenalsous3 9 місяців тому

    can I install docker compose on Mac? or is it not necessary?

    • @leenalsous3
      @leenalsous3 9 місяців тому

      and also, from where can I find the contents of the dockerfile?

    • @ProgramWithGio
      @ProgramWithGio  9 місяців тому +1

      I don't know much about mac so cant say for sure. I would research online on how to get Docker installed, you should be able to.

    • @leenalsous3
      @leenalsous3 9 місяців тому

      @@ProgramWithGio will do, thank youu

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

    In traditional way if your nginx config file have error you must uninstall it sometime will raise error.But in docker you can delete it easily.

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

    ¡Gracias!

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

    Hi Gio, first of all thank you for sharing knowledge in such a shining way!
    Can you please tell me (or redirect to other resources for me to understand) how to let nginx know what we usually tell to Apache through .htaccess in order to route any request to index.php?
    Thank you in advance for any explanation/suggestion and keep up the excellent job!

    • @ProgramWithGio
      @ProgramWithGio  Рік тому +2

      Hey, thank you. Check 10:06 time on this video. It's set to /var/www/public, so you place your index.php within /var/www/public & all requests go through there.

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

      @@ProgramWithGio many thanks for your prompt reply! Sorry for having missed the point while watching the video, previously 👌🙏

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

      @@pasqualealfano6652 no worries 👍

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

    That was amazing , thanks. can't wait for the other videos. May I ask you to cover things like if we set .ini php config file for this docker container , how can we do that ? And also I would like to ask, is it possible to automatically get https certificates for these nginx php docker files for production, and the last question would be is it posdible to use docker for having multiple domains on the same nginx and php server ? If you cover any of these topics , I would appreciate it.

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

      Thank you. I'll try to squeeze another lesson on these topics. Though it will probably be in third section of the course or towards the end of second section. I personally wouldn't have two sites on same nginx container, it's simpler to just have second site with different containers on different port, so one site on port 8000, another on port 8001 and so on.

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

      @@ProgramWithGio that is indeed right. Honestly the last question was maybe just for my specific case. I have a saas service which is more like a shop maker. That users can set domains for their shops. So I've been thinking about solutions that can automate this process of having many domains on the same project.

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

      @@peymanGhaderkurehpaz Got it, yea that makes sense. There are some services out there that let you do that and probably have API that you can integrate with to automate it.

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

      Thanks a lot , I will definitely look for it ❤👌

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

    thank you!

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

    Laracon is great but I normally use Devilbox which comes with lots of images ready to use and a nice dashboard to manage your containers projects

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

      Nice. I haven't used Devilbox, but it sounds cool. Looks like devilbox uses docker.

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

      @@ProgramWithGio give it a try.

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

    Wow so far i only played with Xamp, when i run on this tutorial i feel like i receive a Rock on my Face.. hahaha impossible to graps that in 15min hahahha... will go over tutorial and tutorial later about it since docker is not essential to keep going in the course i hope lol ;)

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

      That's understandable and it's ok. Docker is not a requirement, keep using XAMPP or whatever makes your more productive 🙌

  • @truthteachers
    @truthteachers 2 роки тому +2

    I was having a great time with all your videos until now. Now my fear has set in when your videos from here on are going to be based on docker. You should introduce docker later in the course after all the main concepts have been covered. I dont like to install docker in my PC until such time there is an absolute need. Are all your videos from now on going to be docker based?

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

      Docker is just a tool to have PHP installed along with other things. You don't need to use it at all, you can keep using XAMPP from the first section. It shouldn't make a difference. We do install MySQL using docker later but you already have that with XAMPP so you should be able to skip the installation part of MySQL.
      I decided to introduce it here because it's the beginning of 2nd section & more advanced, so I wanted to show the alternative to XAMPP.
      So in short you can skip this video & skip parts of a couple other videos that adjust Docker configuration, aside from that you should be fine. PHP topics I cover are not Docker related.

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

      @@ProgramWithGio Thank you so much for the update. Phew! Honestly, all this crap with docker and other tools like webpack are making developers life miserable. It may look like gung-ho for the developer but it is stupidity from the beginning. Technology is suppose to make developers life easier not stress them with these rubbish and deviate from the main focus of developing business solutions. I wasted a good 1 hours trying to install WSL and Docker only to find out that it ends up with weird errors. The thought of me trying to debug some idiots problems stressed me out. So, naturally, i just ripped everything out and dumped them in the garbage. Do you believe Windows will ever give Linux a chance to survive?? I decided to stick to things that work both with windows and my hosting provider - Apache. Please do not misunderstand me. I am not hitting out at you but rather at the stupidity technology is heading to. Just imagine the tools a developer has to learn for using vuejs, react etc. Clearly shows the fickle mindedness of software developers. Today, i see developers wasting their entire lifetime chasing their tails around these nonsense when they should be focused on the delivering. We stick to basics.
      Thank you for clearing up my misunderstanding. You are the best. I go through your channel every day and learn more.

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

      I totally understand the frustration, I've been there myself. I don't use docker with Windows because of WSL being clunky which is why I mainly work on Linux on which docker works fine (I just used Docker with WSL in the lesson because I record using Windows). But as I said before it is just a tool, if you are not happy with it you don't have to use it, use whatever makes you more productive & happy. At the end of the day, client does not care whether you use Docker or XAMPP or something else for development, they care for the end result, so get there with whatever makes it easier for you.
      Thank you for the support 💙

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

      I had exactly the same feeling like @mani

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

    Awesome can you show one how to in stall Laravel with docker without sail

  • @Mathias-cq3zo
    @Mathias-cq3zo 3 роки тому

    I tried to replicate this but fail :(. My app has a button which call a bash script. I set "everything right", however when I click this button my container log says """"sh: 1: path/to/script.sh: not found"""" eventhough the path is correct... 😵. Do I have to set special permission to Nginx ?

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

      Not sure I understand what you mean by a button. Why do you need a button in your app to run a bash script? Is your docker set up properly?

    • @Mathias-cq3zo
      @Mathias-cq3zo 3 роки тому

      @@ProgramWithGio it is a button on the frontend that call a php function to do some backend validation and then execute a script that do a "git clone" in order to bring an excel file from a repo on gitlab. However everything in the function called does well except executing the script. Thanks in advance!

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

      It's hard to know what the problem is without looking at the code. It doesn't sound like a docker issue.

  • @omodev4427
    @omodev4427 9 місяців тому

    How can i create a docker image with Microsoft sql server, with exensions enabled php8, nginx? some one help please.

    • @ProgramWithGio
      @ProgramWithGio  9 місяців тому

      Through a command & some configuration most likely. Do research in google on "install microsoft sql server in docker" & try few options

    • @omodev4427
      @omodev4427 9 місяців тому

      I have tried several commands on Google but non works . I thought you could share a working command

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

    awesome

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

    How to mail() from within Docker ..????

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

      Keep watching the series, we get to emailing part later on. You can also search for it in the outline repo or the playlist

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

    I thought I followed along with what you were doing, but I can't get it to work. I keep getting an error that looks like this:
    nginx: [emerg] unexpected "}" in /etc/nginx/conf.d/nginx.conf:14
    I'm still not sure why there isn't a way to get a simple nginx&php container as a direct download since it seems that everyone who uses PHP wants a web server too
    EDIT: ok, I found a typo that caused that error, but it looks like I'm getting other permission errors too. do you have example files we can download for this?

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

      Looks like there might be a typo on line 14 in nginx.conf? You can send me your nginx.conf on Twitter (X) & I can help troubleshoot