Containerizing a MERN Stack Application and Deploying using Docker Compose | Step by Step Guide
HTML-код
- Опубликовано: 29 сен 2024
- Support my work
www.buymeacoff...
GitHub repo for the Project
github.com/iam...
In the video, we will learn how to containerize a MERN stack application and create a Docker Compose file for running multiple container along with the networking in one simple step. A step by step guide is provided in the GitHub repo shared above.
MERN is one of several variations of the MEAN stack (MongoDB, Express, Angular, Node), where the traditional Angular.js front-end framework is replaced with React.js. Other variants include MEVN (MongoDB, Express, Vue, Node), and really any front-end JavaScript framework.
Have any questions while learning ? Don't worry, Join our Doubts Clearing Group.
Join our Doubts Clearing Group
/ @abhishekveeramalla
Here are some more very useful Zero to Hero playlists on the channel.
- Free DevOps Playlist: • DEVOPS ZERO TO HERO CO...
- AWS Zero to Hero Playlist: • AWS Zero to Hero - AWS...
- Terraform Zero to Hero Playlist: • Terraform Zero to Hero
- Python for DevOps Playlist: • Python for DevOps
About me:
========
Instagram: / abhishekveeramalla_off...
Telegram Channel : t.me/abhishekv...
LinkedIn: / abhishek-veeramalla
GitHub: github.com/iam...
Medium: / abhishekveeramalla-av
Disclaimer: Unauthorized copying, reproduction, or distribution of this video content, in whole or in part, is strictly prohibited. Any attempt to upload, share, or use this content for commercial or non-commercial purposes without explicit permission from the owner will be subject to legal action. All rights reserved.
GitHub repo for the Project (refer compose branch for learning)
github.com/iam-veeramalla/MERN-docker-compose
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.
Awesome as expected ❤
How to do it in github actions? What about environment variables which needed for the backend?
frontend container is running but i am unable to connect frontend container from localhost
i mapped port5173 to ec2
what is the issue
Same issue. Did you solve it?
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
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.
@@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
@@kunaljain5266 so did you find a solution?
@@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 ??
@@kunaljain5266 yep, it's probably related to cors
First one to comment
Hope you will enjoy the demo
@@AbhishekVeeramalla yes definitely
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🙌🙌
Thanks
@@AbhishekVeeramallais the ansible series done?
50min passes just in 5 min ! simple clear explanation
❤️
Mad respect for the effort of making whole setup,
You're doing great work sir, keep it up.
Thank you very much!
When I walkthrough your project by doing things not listening the entire videos ,its really feels amazed 😊❤.
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
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??
Your really a good teacher sir...❤.... Thank you so much for ur valuable lessons
Best learning content is here
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..
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.
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.
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?
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😊
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?😊
Hi Abhishek I made this project's frontend with distroless image
Hi Abhishek, Can you deploy flask application using docker . I mean can you make one video
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!
Abhishek include grafana and Prometheus in project
w content
abhishek garu.....i need to give interview soon....i would like to have interview questions for aws devops engineer from you....plz share
Thanks Abhishek, such an amazing explantion with basics to end flow. Thank you
First comment
Thanks
what changes would be needed for distroless images here? Thanks for the amazing content!
This is one of the videos I've been waiting for since I started following your channel❤
sir please create one more devopsified project with complete details like env secret
pls upload more videos for azure related contents
Thank you very much, Abhishek
very very helpful thanks dear
❤ From Nigeria 🇳🇬
Thanks
Check the node version
😊
Hope you will enjoy the demo
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!
if you are using aws ec2 then security groups ports so open for ssh(port number) or all alltraffic
Lovely content ❤
Awesome ❤
Thanks you so much @Abhishek.Veeramalla . Successfully implemented MERN stack app
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
same issue happend to me it seems frontend cant able to communicate with backend
@@Sundharesan.P may be the endpoint issues api url of backend and frontend
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.
Noted
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)
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.
Love it