Containerizing a MERN Stack Application and Deploying using Docker Compose | Step by Step Guide

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ม.ค. 2025

ความคิดเห็น • 111

  • @AbhishekVeeramalla
    @AbhishekVeeramalla  5 หลายเดือนก่อน +5

    GitHub repo for the Project (refer compose branch for learning)
    github.com/iam-veeramalla/MERN-docker-compose

    • @AbhishekPandeySunny
      @AbhishekPandeySunny 4 หลายเดือนก่อน

      Hi AV - you may want to include how to setup a local environment to run the app before starting to write the dockerfile for both frontend and backend apps. Setting up the right connection string for Mongo DB access is tricky job here. Thanks.

  • @redsarg99
    @redsarg99 3 หลายเดือนก่อน +3

    Love how at #19min you solve all my dockerfile queries in less than a minute. Really appreciate you explaining from scratch.

  • @bharathidesu6668
    @bharathidesu6668 4 หลายเดือนก่อน +7

    50min passes just in 5 min ! simple clear explanation

  • @soumyadipchatterjee2267
    @soumyadipchatterjee2267 4 หลายเดือนก่อน +3

    When I walkthrough your project by doing things not listening the entire videos ,its really feels amazed 😊❤.

  • @simranbanwait
    @simranbanwait 5 หลายเดือนก่อน +5

    Mad respect for the effort of making whole setup,
    You're doing great work sir, keep it up.

  • @mulcro
    @mulcro 3 หลายเดือนก่อน +1

    Beautiful explanation! Very easy to follow and was able to containerize my app

  • @Raghu_Devops_Aspirant
    @Raghu_Devops_Aspirant 5 หลายเดือนก่อน +1

    Thank you so much, @Abhishek.Veeramalla , for your incredible efforts and generosity in sharing your knowledge with us. Your explanations are clear, concise, and extremely helpful. You make complex topics easier to understand, and it's clear how passionate you are about helping others succeed. Keep up the amazing work-you're making a real difference for so many of us!

  • @jayalathak3976
    @jayalathak3976 5 หลายเดือนก่อน +1

    Your really a good teacher sir...❤.... Thank you so much for ur valuable lessons

  • @its_gokhul
    @its_gokhul 5 หลายเดือนก่อน

    This is one of the videos I've been waiting for since I started following your channel❤

  • @jitinkumar835
    @jitinkumar835 5 หลายเดือนก่อน +1

    Best learning content is here

  • @sangativamsikrishna1691
    @sangativamsikrishna1691 5 หลายเดือนก่อน

    Thanks Abhishek, such an amazing explantion with basics to end flow. Thank you

  • @praveenkore842
    @praveenkore842 5 หลายเดือนก่อน +1

    Awesome as expected ❤

  • @Just_be_there
    @Just_be_there 5 หลายเดือนก่อน +7

    Why are you prove everything wrong?When we became skills that did not match the current market...
    Yes, I'm Abhishek is here to provide free...No problem gohead🙌🙌

  • @hehehe4206
    @hehehe4206 5 หลายเดือนก่อน +5

    Hi anna, why do we need to port map mondb , both backend and db are running in same network , and we need not to host data base to the world right??

  • @snehasish-bhuin
    @snehasish-bhuin 5 หลายเดือนก่อน

    Lovely content ❤

  • @S.Ajju1214
    @S.Ajju1214 5 หลายเดือนก่อน

    Awesome ❤

  • @chandugummoji7504
    @chandugummoji7504 4 หลายเดือนก่อน

    Thank you very much, Abhishek

  • @Imran_kpk
    @Imran_kpk 5 หลายเดือนก่อน

    very very helpful thanks dear

  • @sreevenkateshyelamolu5429
    @sreevenkateshyelamolu5429 หลายเดือนก่อน +1

    I remember you mentioning the network of the backend container and db container should be isolated from the frontend container when you talked about docker networking. On the contrary here we are using the same network for all three containers...but what happens if the frontend container is compromised?

  • @lakshmielumalai4125
    @lakshmielumalai4125 3 หลายเดือนก่อน +1

    Hi Abhishek, I am following this course. Thanks a ton!
    1. At 28:41 you are not building an image for mongo instead running the container on mongodb:latest. For frontend and backend image is built and container is run. Why not for mongo or db?
    2. Also, I tried the example but if I give localhost:port it is not working for me. What is that I am missing?
    3. In real time scenario, how will we debug the Dockerfiles / the dockercompose.yaml

    • @jaikrishnam7041
      @jaikrishnam7041 หลายเดือนก่อน

      Abhishek, Same here why you have not created a docker file for the mongo DB and you haven't created a volume for DB how are you using in docker run -v
      @lakshmielumalai4125,
      2. localhost:port is not working check if the port are already used in any other service or if you are using ec2 instance, make the necessary changes in security groups like enabling the port number.

  • @ThePercivalGlyde
    @ThePercivalGlyde หลายเดือนก่อน

    nice

  • @naitiksinghal4378
    @naitiksinghal4378 5 หลายเดือนก่อน +1

    w content

  • @iramkhan2644
    @iramkhan2644 18 วันที่ผ่านมา +1

    done
    11/1/25

  • @jaikrishnam7041
    @jaikrishnam7041 หลายเดือนก่อน

    Abhishek, 28:41 here why you have not created a docker file for the mongo DB and you haven't created a volume for DB how are you using in docker run -v, please explain, Thanks..

    • @TamilTipsAbdur
      @TamilTipsAbdur 28 วันที่ผ่านมา +1

      Did you found?bro

    • @TamilTipsAbdur
      @TamilTipsAbdur 28 วันที่ผ่านมา +2

      I think its like docker hello world he is running mongodb directly without any dockerfile

    • @jaikrishnam7041
      @jaikrishnam7041 27 วันที่ผ่านมา +1

      @@TamilTipsAbdur , mangodb:latest image exists in a public or private Docker registry accessible to Docker, it will be pulled automatically and run this container

  • @sagarbirla2879
    @sagarbirla2879 4 หลายเดือนก่อน

    Hi Abhishek I made this project's frontend with distroless image

  • @vasanth-kumar-amarai-elluru
    @vasanth-kumar-amarai-elluru 5 หลายเดือนก่อน +1

    😊

  • @ayushshende4290
    @ayushshende4290 5 หลายเดือนก่อน

    what changes would be needed for distroless images here? Thanks for the amazing content!

  • @okunniyigbenga1259
    @okunniyigbenga1259 5 หลายเดือนก่อน +1

    ❤ From Nigeria 🇳🇬

  • @YashwanthKatta-x1l
    @YashwanthKatta-x1l 2 หลายเดือนก่อน

    Hi Abhishek I am saving employee record then it's showing empty when it goes to next page can you please tell me why ? My front end and back end container are communicating I checked it .

    • @Sahil_00369
      @Sahil_00369 หลายเดือนก่อน

      same here, if anyone solved the issue please do comment

    • @gurubalaguru8465
      @gurubalaguru8465 หลายเดือนก่อน +2

      @@Sahil_00369 The issue is because the react application calls the api from the browser. In the code, the api URLs are configured as localhost. In this demo, Abishek has used docker desktop to run the container which will automatically resolve localhost to 127.0.0.1 (loop back ip address).
      In case,
      1. you are running docker in docker desktop in windows replace localhost to 127.0.0.1
      ./mern/frontend/src/components/RecordList.jsx: const response = await fetch(`127.0.0.1:5050/record/`);
      ./mern/frontend/src/components/RecordList.jsx: await fetch(`127.0.0.1:5050/record/${id}`, {
      ./mern/frontend/src/components/Record.jsx: `127.0.0.1:5050/record/${params.id.toString()}`
      ./mern/frontend/src/components/Record.jsx: response = await fetch("127.0.0.1:5050/record", {
      ./mern/frontend/src/components/Record.jsx: response = await fetch(`127.0.0.1:5050/record/${params.id}
      2. If you are running your docker in an EC2 instance or Azure VM, replace localhost to public IPof your VM. Also in security group expose port 5050 inbound for all ips.
      ./mern/frontend/src/components/RecordList.jsx: const response = await fetch(`:5050/record/`);
      ./mern/frontend/src/components/RecordList.jsx: await fetch(`:5050/record/${id}`, {
      ./mern/frontend/src/components/Record.jsx: `:5050/record/${params.id.toString()}`
      ./mern/frontend/src/components/Record.jsx: response = await fetch("9:5050/record", {
      ./mern/frontend/src/components/Record.jsx: response = await fetch(`:5050/record/${params.id}
      3. IIf you are running docker in vmware or virtual box, replace the localhost to vmware or virtualbox host IP address

    • @gowshikag
      @gowshikag หลายเดือนก่อน

      Same here : on inspect elements getting warning as “failed to load resource:could not connect to server .

  • @Kk-rl7nv
    @Kk-rl7nv 5 หลายเดือนก่อน

    Hi Abhishek,
    Thanks for the video, could help to create a zero to hero series on Hashicorp vault , we got many video like install configure using but many concepts which needs a final touch from you like injecting and types of injecting credentials on Kubernetes pod from kv2 and also covered dynamic injecting secrets from vault to RDS/ ec2 ets and on Kubernetes it getting the secret automatically😊

  • @prasantkumar1986
    @prasantkumar1986 4 หลายเดือนก่อน

    Thanks you so much @Abhishek.Veeramalla . Successfully implemented MERN stack app

  • @sravandatha9511
    @sravandatha9511 5 หลายเดือนก่อน

    Check the node version

  • @amit_m17
    @amit_m17 19 ชั่วโมงที่ผ่านมา

    frontend, mongodb and backend are mapped to public ip address of ec2 instance and perfectly running. but the web page is not showing the saved record. it seems issue with localhost configuration on RecordList.jsx file . I changed it to public ip address in RecordList.jsx file but still have no luck. Please help if there is different configuration in case we are running it on ec2 instance but not local machine

  • @khanhle9022
    @khanhle9022 2 หลายเดือนก่อน +1

    I have a problem that my localhost:3000 stuck at loading after run “sudo docker logs front-end”. Do you know what is the cause and Can you please give me some solutions? Thank you so much for your amazing video ❤

    • @sivach8667
      @sivach8667 2 หลายเดือนก่อน +1

      so... you mapped the port 5173 of the container to 3000 and you're facing the problem? Please give more context to replicate the issue... because if its your local system you're using to do this, its different and if its EC2 from aws or any VM from other cloud provider, you need to check the inbound rules.

    • @khanhle9022
      @khanhle9022 หลายเดือนก่อน

      @@sivach8667 Thank you for your kind reply! However, I've already resolved it ❤.

  • @Madhu9738
    @Madhu9738 5 หลายเดือนก่อน +1

    First one to comment

    • @AbhishekVeeramalla
      @AbhishekVeeramalla  5 หลายเดือนก่อน

      Hope you will enjoy the demo

    • @Madhu9738
      @Madhu9738 5 หลายเดือนก่อน

      @@AbhishekVeeramalla yes definitely

  • @zainn7336
    @zainn7336 5 หลายเดือนก่อน

    sir please create one more devopsified project with complete details like env secret

  • @preetimansahoo5617
    @preetimansahoo5617 4 หลายเดือนก่อน +1

    Hi Abhisek,
    Can this be implemented on EC2 t2.micro?
    If not what configuration type should I use?

    • @goofyguy6954
      @goofyguy6954 3 หลายเดือนก่อน

      I don't think so

    • @gurubalaguru8465
      @gurubalaguru8465 หลายเดือนก่อน

      You can implement this setup in EC2 t2.micro, infact in any EC2 instance or Azure VM with docker and docker compose installed

  • @Itsrush887
    @Itsrush887 3 หลายเดือนก่อน

    Hi abhisek,
    There is an issue with the application code in handling cors i guess.

  • @mehedihasanridoy1086
    @mehedihasanridoy1086 4 หลายเดือนก่อน

    How to do it in github actions? What about environment variables which needed for the backend?

  • @msatyamounika
    @msatyamounika 4 หลายเดือนก่อน

    Hi Abhishek, a query. In your repo, I see that there is a separate field named "environment" in docker-compose.yml. At what kind of scenarios do we need to use it?

    • @gurubalaguru8465
      @gurubalaguru8465 หลายเดือนก่อน

      When ever you want to store any environment variables like PORT=5050, or evern any environment variables which will be used by the code can be stored there.

  • @abhishekswarnakar6037
    @abhishekswarnakar6037 หลายเดือนก่อน

  • @AswinAswin-i7t
    @AswinAswin-i7t 5 หลายเดือนก่อน

    pls upload more videos for azure related contents

  • @gudamahendar6992
    @gudamahendar6992 4 หลายเดือนก่อน

    Abhishek include grafana and Prometheus in project

  • @ragav6948
    @ragav6948 16 วันที่ผ่านมา

    If i try in aws linux its not working frontend i can access backend or database i can’t access but I tried in local it’s working … what should i do in aws Linux

  • @AayushSinha-d1c
    @AayushSinha-d1c 4 หลายเดือนก่อน

    Thank you, sir, for the brilliant explanation! 🙏. I’m running into a bit of trouble-my container is running smoothly during deployment, but I am getting a 'Site can't be reached' error. Any assistance would be greatly appreciated!

    • @mouni-o-
      @mouni-o- 4 หลายเดือนก่อน +1

      if you are using aws ec2 then security groups ports so open for ssh(port number) or all alltraffic

  • @venugopal-nc3nz
    @venugopal-nc3nz 4 หลายเดือนก่อน

    Hi Abhishek, Can you deploy flask application using docker . I mean can you make one video

  • @nousheensafoora206
    @nousheensafoora206 4 หลายเดือนก่อน

    frontend container is running but i am unable to connect frontend container from localhost
    i mapped port5173 to ec2
    what is the issue

  • @Dilip-nx2sj
    @Dilip-nx2sj 5 หลายเดือนก่อน +1

    First comment

  • @ankitsarkar7377
    @ankitsarkar7377 4 หลายเดือนก่อน

    Hello Abhishek, I have tried to deploy the app into GCP env but somehow the mongodb is not able to save and show the user details can you please help in this issue?😊

  • @devdomain1498
    @devdomain1498 4 หลายเดือนก่อน

    Love it

  • @Imran_kpk
    @Imran_kpk 5 หลายเดือนก่อน

    which urls l will be change that exists in codes or please mention which urls will be change i have change and create manifests also work but when i add employ then data not print in UI reman all things frontend backend and mongo access

    • @Sundharesan.P
      @Sundharesan.P 4 หลายเดือนก่อน +1

      same issue happend to me it seems frontend cant able to communicate with backend

    • @Imran_kpk
      @Imran_kpk 4 หลายเดือนก่อน

      @@Sundharesan.P may be the endpoint issues api url of backend and frontend

  • @kunaljain5266
    @kunaljain5266 4 หลายเดือนก่อน

    Hello @Abhishek, Thanks for making such good contents on DevOps tools. I have used docker playground for creating all the docker containers.
    However, I am able to create all the containers fine, But after clicking the Save Employee Records I am still not getting the details.
    I have followed every step and all the 3 containers are running fine in the same network "mern" that was created.
    Can you please help me if anything I am missing ?
    Thanks

    • @AbhishekVeeramalla
      @AbhishekVeeramalla  4 หลายเดือนก่อน

      Please open the developer console as shown in the video and see what are you missing ?
      I have also shared the docker compose file for your reference in the compose branch. Please use that.

    • @kunaljain5266
      @kunaljain5266 4 หลายเดือนก่อน

      @@AbhishekVeeramalla Failed to load resource: net::ERR_CONNECTION_REFUSED
      Getting this error..
      I have used the provided compose branch and ran the docker compose up command... But unable to save the employee details

    • @senpaihere6512
      @senpaihere6512 4 หลายเดือนก่อน

      @@kunaljain5266 so did you find a solution?

    • @kunaljain5266
      @kunaljain5266 4 หลายเดือนก่อน

      @@senpaihere6512 Nope.. I redeployed it and same issue.. everything runs fine but when click on save employee details it's not showing up.
      Are you facing the same ??

    • @senpaihere6512
      @senpaihere6512 4 หลายเดือนก่อน

      @@kunaljain5266 yep, it's probably related to cors

  • @ramsep17
    @ramsep17 4 หลายเดือนก่อน +1

    Hi @Abhishek, i followed your video but there seems to be a problem. with database volumes. i was trying this in ubuntu in gcp. i have followed the instructions but when i create a user it just shows empty record. not sure if i have to configure the volume differently.. before connecting it to database it wouldnt even reload the page when i click on save employee record. but after connecting, it looks like its saving but its not displaying any output. if anyone has the same issue. if you found the solution. please let me know..

    • @AbhishekVeeramalla
      @AbhishekVeeramalla  4 หลายเดือนก่อน +2

      You need to create a Docker volume and mount the volume to the DB or you need to bind mount, I think its normal communicated exactly in the video.
      But you can see in the Docker Compose I have a step for volume.
      Can you run “docker-compose up -d” , I think it should work and you should have the app running.

    • @ramsep17
      @ramsep17 4 หลายเดือนก่อน +2

      Thank you Abhishek for the prompt response. I might have missed it. Will check again and try it. Thanks again. Great work. I follow all of your videos.

    • @srinu1099
      @srinu1099 3 หลายเดือนก่อน

      Hi @ramsep17,
      Is it working properly for you after using docker compose.yml ??? Me also facing same kind of issue..after deploying with docker compose also...records are not getting saved....Not sure .what went wrong..🙂‍↕️

    • @ramsep17
      @ramsep17 3 หลายเดือนก่อน

      @@srinu1099 I was not able to troubleshoot this..

    • @Itsrush887
      @Itsrush887 3 หลายเดือนก่อน

      ​@@ramsep17 application networking, some issue with the CORS configuration...

  • @SoothingMusic2k23
    @SoothingMusic2k23 3 หลายเดือนก่อน

    @AbhishekVeeramalla Even after giving the inbound rules in ec2, unable to access local hosts 5173, 27017,5050. Couldn’t find why

    • @ganeshpawar231
      @ganeshpawar231 21 วันที่ผ่านมา

      Please do it in local machine if you have like windows, ubuntu or else it will not work. CORS problem.

  • @rsmsm1458
    @rsmsm1458 5 หลายเดือนก่อน

    abhishek garu.....i need to give interview soon....i would like to have interview questions for aws devops engineer from you....plz share

  • @shabarimeda4970
    @shabarimeda4970 5 หลายเดือนก่อน +2

    Hi Abhishek anna very helpful video and rare content on TH-cam. Hat's off anna. Thank you so much.
    Please do videos on how to push images to Azure container registry or Elastic container registry using GitHub actions and deploy on a Vm.
    Because many startups won't use kubernetes.
    Thanks anna.

  • @safooraNousheen
    @safooraNousheen 3 หลายเดือนก่อน

    can I showcase this project in my resume?

  • @jayjw1
    @jayjw1 3 หลายเดือนก่อน

    Hey Abhishek, amazing tutorial.
    I was wondering if we have to run
    % docker compose up -d --build
    command if we want to make changes to the files to use for our own project?

  • @harshgupta399
    @harshgupta399 4 หลายเดือนก่อน

    bro in ur git repo readme
    docker run --network=demo --name mongodb -d -p 27017:27017 -v ~/opt/data:/data/db mongodb:latest
    commands seems wrong it should be mongo:latest not mongodb:latest

  • @vasd8706
    @vasd8706 5 หลายเดือนก่อน

    Anyone getting the below error, when trying to run the container for frontend?
    > client@0.1.0 dev
    > vite --host 0.0.0.0
    ✘ [ERROR] Cannot start service: Host version "0.19.12" does not match binary version "0.21.5"
    1 error
    failed to load config from /app/vite.config.js
    Error: The service was stopped
    at /app/node_modules/esbuild/lib/main.js:1084:25
    at responseCallbacks. (/app/node_modules/esbuild/lib/main.js:704:9)
    at Socket.afterClose (/app/node_modules/esbuild/lib/main.js:694:28)
    at Socket.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

    • @sayantanmanna1360
      @sayantanmanna1360 4 หลายเดือนก่อน

      I think it happens because you are copying the node_modules from your local to the container. Create a .dockerignore file inside frontend and add node_modules/ to it . Build a fresh image and it should work.

    • @SoothingMusic2k23
      @SoothingMusic2k23 3 หลายเดือนก่อน

      @AbhishekVeeramalla Even after giving the inbound rules in ec2, unable to access local hosts 5173, 27017,5050. Couldn’t find why

    • @ritika_yoo
      @ritika_yoo หลายเดือนก่อน

      @@SoothingMusic2k23 why would you expose your backend and database to world, you can use HTTP://public-ip:5173 for frontend