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

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025

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

  • @AbhishekVeeramalla
    @AbhishekVeeramalla  4 месяца назад +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 4 месяца назад +5

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

  • @jayalathak3976
    @jayalathak3976 4 месяца назад +1

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

  • @mulcro
    @mulcro 2 месяца назад +1

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

  • @its_gokhul
    @its_gokhul 4 месяца назад

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

  • @Raghu_Devops_Aspirant
    @Raghu_Devops_Aspirant 4 месяца назад +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!

  • @jitinkumar835
    @jitinkumar835 4 месяца назад +1

    Best learning content is here

  • @praveenkore842
    @praveenkore842 4 месяца назад +1

    Awesome as expected ❤

  • @hehehe4206
    @hehehe4206 4 месяца назад +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??

  • @sangativamsikrishna1691
    @sangativamsikrishna1691 4 месяца назад

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

  • @Just_be_there
    @Just_be_there 4 месяца назад +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🙌🙌

  • @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?

  • @S.Ajju1214
    @S.Ajju1214 4 месяца назад

    Awesome ❤

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

  • @snehasish-bhuin
    @snehasish-bhuin 4 месяца назад

    Lovely content ❤

  • @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 26 дней назад +1

      Did you found?bro

    • @TamilTipsAbdur
      @TamilTipsAbdur 26 дней назад +2

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

    • @jaikrishnam7041
      @jaikrishnam7041 26 дней назад +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

  • @chandugummoji7504
    @chandugummoji7504 4 месяца назад

    Thank you very much, Abhishek

  • @Imran_kpk
    @Imran_kpk 4 месяца назад

    very very helpful thanks dear

  • @ayushshende4290
    @ayushshende4290 4 месяца назад

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

  • @ThePercivalGlyde
    @ThePercivalGlyde Месяц назад

    nice

  • @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 Месяц назад +1

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

  • @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 Месяц назад +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 ❤.

  • @naitiksinghal4378
    @naitiksinghal4378 4 месяца назад +1

    w content

  • @vasanth-kumar-amarai-elluru
    @vasanth-kumar-amarai-elluru 4 месяца назад +1

    😊

  • @ragav6948
    @ragav6948 15 дней назад

    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

  • @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?

  • @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?😊

  • @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

  • @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

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

  • @prasantkumar1986
    @prasantkumar1986 4 месяца назад

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

  • @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 20 дней назад

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

  • @Imran_kpk
    @Imran_kpk 4 месяца назад

    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

  • @sagarbirla2879
    @sagarbirla2879 4 месяца назад

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

  • @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

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

  • @Kk-rl7nv
    @Kk-rl7nv 4 месяца назад

    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😊

  • @okunniyigbenga1259
    @okunniyigbenga1259 4 месяца назад +1

    ❤ From Nigeria 🇳🇬

  • @zainn7336
    @zainn7336 4 месяца назад

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

  • @venugopal-nc3nz
    @venugopal-nc3nz 4 месяца назад

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

  • @safooraNousheen
    @safooraNousheen 3 месяца назад

    can I showcase this project in my resume?

  • @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

  • @abhishekswarnakar6037
    @abhishekswarnakar6037 Месяц назад

  • @sravandatha9511
    @sravandatha9511 4 месяца назад

    Check the node version

  • @Madhu9738
    @Madhu9738 4 месяца назад +1

    First one to comment

  • @AswinAswin-i7t
    @AswinAswin-i7t 4 месяца назад

    pls upload more videos for azure related contents

  • @rsmsm1458
    @rsmsm1458 4 месяца назад

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

  • @gudamahendar6992
    @gudamahendar6992 4 месяца назад

    Abhishek include grafana and Prometheus in project

  • @Dilip-nx2sj
    @Dilip-nx2sj 4 месяца назад +1

    First comment

  • @devdomain1498
    @devdomain1498 4 месяца назад

    Love it

  • @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?

  • @shabarimeda4970
    @shabarimeda4970 4 месяца назад +2

    Hi Abhishek anna very helpful video and rare content on RUclips. 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.

  • @iramkhan2644
    @iramkhan2644 17 дней назад

    done
    11/1/25

  • @vasd8706
    @vasd8706 4 месяца назад

    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

  • @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