Тёмный

Learn Docker - DevOps with Node.js & Express 

freeCodeCamp.org
Подписаться 10 млн
Просмотров 350 тыс.
50% 1

Learn the core fundamentals of Docker by building a Node/Express app with a Mongo & Redis database.
We'll start off by keeping things simple with a single container, and gradually add more complexity to our app by integrating a Mongo container, and then finally adding in a redis database for authentication.
We'll learn how to do things manually with the cli, then move on to docker compose. We'll focus on the challenges of moving from a development environment to a production environment.
We'll deploy and Ubuntu VM as our production server, and utilize a container orchestrator like docker swarm to handle rolling updates.
✏️ Course developed by Sanjeev Thiyagarajan. Check out his channel: / @sanjeevthiyagarajan
⭐️ Course Contents ⭐️
0:00:14 Intro & demo express app
0:04:18 Custom Images with Dockerfile
0:10:34 Docker image layers & caching
0:20:26 Docker networking opening ports
0:26:36 Dockerignore file
0:31:46 Syncing source code with bind mounts
0:45:30 Anonymous Volumes hack
0:51:58 Read-Only Bind Mounts
0:54:58 Environment variables
0:59:16 loading environment variables from file
1:01:31 Deleting stale volumes
1:04:01 Docker Compose
1:21:36 Development vs Production configs
Part 02: Working with multiple containers
1:44:47 Adding a Mongo Container
2:01:48 Communicating between containers
2:12:00 Express Config file
2:21:45 Container bootup order
2:32:26 Building a CRUD application
2:51:27 Sign up and Login
3:06:57 Authentication with sessions & Redis
3:34:36 Architecture Review
3:40:48 Nginx for Load balancing to multiple node containers
3:54:33 Express CORS
Part 03: Moving to Prod
3:57:44 Installing docker on Ubuntu(Digital Ocean)
4:03:21 Setup Git
4:05:37 Environment Variables on Ubuntu
4:14:12 Deploying app to production server
4:18:57 Pushing changes the hard way
4:25:58 Rebuilding Containers
4:27:32 Dev to Prod workflow review
4:30:50 Improved Dockerhub workflow
4:46:10 Automating with watchtower
4:56:06 Why we need an orchestrator
5:03:32 Docker Swarm
5:16:13 Pushing changes to Swarm stack
--
Learn to code for free and get a developer job: www.freecodeca...
Read hundreds of articles on programming: freecodecamp.o...

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 439   
@rahulsriram6295
@rahulsriram6295 3 года назад
This ain't any tutorial. This is a professional course. Thank you so much Sanjeev!
@sexayboiee
@sexayboiee 3 года назад
haha forreal my work is following a very similar flow.
@ManishRanjanBehera-sl5ry
@ManishRanjanBehera-sl5ry 4 месяца назад
Current Mongosh Log ID: 6630905f044a6f3bd62202d7 Connecting to: mongodb://@127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5 MongoServerError: Authentication failed. can you help
@FilipeFreire
@FilipeFreire 3 года назад
Explaining Docker with such ease sure doesn't seem like an easy task, but this guy sure nailed it! Fantastic job really, amazing to have this for free! Cheers!
@manikandansivasankar6729
@manikandansivasankar6729 3 года назад
This literally is a cheatsheet for anyone who aspires to be a DevOps engineer. Excellent content. Thanks for all the hard work that has been put into making this wholesome course.
@dpSimi2244
@dpSimi2244 2 года назад
If you get "bash: mongo: command not found" at 1:49:00, then Use mongosh. mongo shell was deprecated in mongo:6.0.
@deepanshumodi2000
@deepanshumodi2000 Год назад
thanks for pointing out man
@vonderklaas
@vonderklaas Год назад
Nice catch, thanks
@errortaker2553
@errortaker2553 3 года назад
What I like about this instructor is that he knows the questions going through your mind and answers them. Superb teaching skills
@buttersstotch872
@buttersstotch872 2 года назад
Exactly. I keep thinking "there must be an easier way..." and then he shows us. The benefit is that your knowledge is built from the ground up.
@therealmattplayer
@therealmattplayer 3 года назад
Absolutely brilliant! Perfect pace, excellent explanations and his way of letting something fail to investigate why and how to remedy the issue. Most of the docker tutorials I have found seem to assume that you already know a lot about docker or its underlying concepts but this guy really does take you through in such a logical way. I'll definitely be checking out his other videos once I am through this!!
@Djzaamir
@Djzaamir 3 года назад
One of the most comprehensive docker tutorials on the internet.
@alberttoo5807
@alberttoo5807 Год назад
First of all i'd like to say thank you to Sanjeev for this master class and for anyone on windows having trouble using the pwd command with nodemon to set up the bind mount on bash you also have to set the watch flag -v "$(pwd -W):/app" for the docker run command in addition to the -L flag when setting up nodemon in the package.json
@kartikgarasia5685
@kartikgarasia5685 2 года назад
Hello Sanjeev I jave just completed this course and I have nothing but respect for you. Doing so much hard work and providing it for free is not an easy thing to do. It really helped me understand how to deal with docker. Now I am comfortable adopting docker workflow in my projects. Once again thank you so much for creating this series.
@iadorepop
@iadorepop 3 года назад
I was searching for good docker tutorial to use in my project. Thanks free code camp. You guys never disappoint!
@mafelojr
@mafelojr 23 часа назад
This is the best docker tutorial i have come across
@chrispohlmann2499
@chrispohlmann2499 Год назад
Just for information: The command mongo to log into the database is deprecated. As of now it is mongosh -u "username" -p "password"
@evant4194
@evant4194 Год назад
My brother, it's people like yourself who make this world a better place!! Not even Chat GPT could help me with this. Thank you so much!
@ogunbanjopeter9930
@ogunbanjopeter9930 Год назад
thank you so much this is life saving
@BerndBausch
@BerndBausch 3 года назад
@1:38:05 The statement 'if [ $NODE_DEV = "development" ]' requires spaces because '[' is a command (it's an alternative to the 'test' command). The condition between the square brackets consists of three parameters to the '[' command, which need to be separated from each other.
@judevector
@judevector 10 месяцев назад
One thing i noticed about Sanjeev tutorials is they are top notch production courses, man teaches core knowledge you will need in the job . I even have a playlist i dedicate just to his courses/tutorials. Man is a legend 🙌
@tonimaunde
@tonimaunde 3 года назад
I can thank you enough for this. From a complete newbie in DevOps, in 2 days I was able to dockerize and put into production my Express and Postgres api + Nginx. Thank you.
@GauravYadav-rv7wx
@GauravYadav-rv7wx 3 года назад
Sanjeev Thiyagarajan, you have the ability to become a real teacher. You can solve the curiosity. Thanks. Keep up the great work
@rushikeshsabde1875
@rushikeshsabde1875 3 года назад
Please do a course on node and express microservices
@marslogics
@marslogics 3 года назад
This same setup can be used as a micro service
@abhijeetshikharvlog1444
@abhijeetshikharvlog1444 3 года назад
Agree
@oneeminem2666
@oneeminem2666 3 года назад
incase you have found any resources please feel free to share
@samhadi7972
@samhadi7972 3 года назад
A microservice tutorial would be awesome, but for now knowing docker, kubernetes, pub/sub, queues, load balancers, and also dealing with data consistency between services, and also understanding event driven architecture in general would be good to know before that and there is many videos about that. Building production grade microservice that actually scale and aren’t a nightmare to manage is quite complex and requires alot of smart design choices and knowledge to pull off, good luck on your journey friends
@imchiennb
@imchiennb 3 года назад
Basically, you can think microservices system as docker compose with multiple services.
@Hadi-wn2hw
@Hadi-wn2hw 3 года назад
Great when you search for docker and node and find a course uploaded 2hrs ago wow!
@haq_se_dkp
@haq_se_dkp 3 года назад
The best tutorials are the ones where the instructor is to the point, does not create any unnecessary jokes(which only she/he thinks are funny), does not make weird noises while talking, avoids derailing off, provides a no-nonsense approach, and does not fake accents. This one checks most boxes. Would've been much better if he could've avoided that tongue clicking noises or the 'umms' but they're quite rare, so it's all good :)
@boricuababyhuey7576
@boricuababyhuey7576 3 года назад
Fair point for free content I am not as picky but def agree with being to the point.
@jackthegenius1
@jackthegenius1 3 года назад
🐳 Github repo: github.com/Sanjeev-Thiyagarajan/node-docker
@arlandmv4053
@arlandmv4053 3 года назад
OMG!! I need more hours in my days!
@MrSalFav
@MrSalFav 3 месяца назад
This tutorial is the best course on the Docker and Docker Compose I have watched. Thank you so much !
@yuqin9912
@yuqin9912 3 года назад
One of the best docker and node tutorials I've taken. The explanation is clear, the code is pretty, the author is funny.
@saywell_
@saywell_ 2 года назад
Redis client doesn't work in v4 of Redis. Replace the redisClient code with this: let redisClient = redis.createClient({ legacyMode: true, socket: { port: REDIS_PORT, host: REDIS_URL } }) redisClient.connect().catch(console.error)
@mertkelleci1020
@mertkelleci1020 2 года назад
Thank you.
@nameisdeee
@nameisdeee 2 года назад
Thanks man
@fdl9308
@fdl9308 2 года назад
you are the guy
@ernestoalonso5565
@ernestoalonso5565 2 года назад
Man thank you so much! I was stuck in this for hours. Greetings!!
@hamzanasir1590
@hamzanasir1590 2 года назад
Thanks man
@abhishekkumarjha1526
@abhishekkumarjha1526 2 года назад
At around 1:50:00, use mongosh -u " " -p " " instead of mongo, as it has been deprecated.
@abduljabbar8404
@abduljabbar8404 2 года назад
It saved a lot of time
@abhishekkumarjha1526
@abhishekkumarjha1526 2 года назад
@@abduljabbar8404 alright. I wasted a lot of time looking for the solution, and posted it so others don't have to waste their time.
@meryemar7403
@meryemar7403 Год назад
you are valuable
@abhishekkumarjha1526
@abhishekkumarjha1526 Год назад
@@meryemar7403 Thanks. Hope it helped in some way. All the best.
@chaoticqubit
@chaoticqubit Год назад
Sanjeev is an O.G. instructor! No doubt about it! I completed your FastAPI course, now the docker course. My respect for you has grown infinite times now.
@prateekkalkonda3465
@prateekkalkonda3465 Год назад
At 1:49:13, mongo is now replaced with mongosh hope it will be helpful.
@zahradeenmuazu5448
@zahradeenmuazu5448 Год назад
This helped a lot, thanks
@HalimMoody
@HalimMoody Год назад
this helped!!
@r.kucherenko
@r.kucherenko Год назад
I would like to shake your hand, my good man. just brilliant
@aroneinhorn8570
@aroneinhorn8570 3 года назад
Just now finished this over five hour course. It is very informative and easy to follow along. Thank you very much to Sanjeev. And thank you to Quincy for bringing this to us.
@IonizedComa
@IonizedComa 8 месяцев назад
Perfect for me who struggles with deployment with docker containers for personal projects
@manishbhardwaj4587
@manishbhardwaj4587 7 месяцев назад
What an amazing teacher and lecture. Yes it take time to understand the thoughts but if you have the will then surely this is the way to learn docker!!
@DanielWachira-de9yg
@DanielWachira-de9yg Год назад
This the best docker course I have come across since I started my Journey in DevOps.Thank you freeCodeCamp
@DaviAreias
@DaviAreias 2 года назад
It took me a lot of time to begin to understand Docker and I’m glad I’ve found this video, it makes thing super fun if you already learned how to deploy an app to a server
@mehdirahimi1787
@mehdirahimi1787 3 года назад
If I want to say my feeling about this video: It's more than Amazing.
@oddjob62
@oddjob62 3 года назад
Even as someone (infrastructure/ops) who only knows the very basics of Javscript, I managed to follow this course, and found it very informative and enjoyable. Definitely gave me some great insight into the Dev side of the fence.
@RolandTutorials
@RolandTutorials Год назад
Hello Alex, please i have questions about infrastructure ops. How can i contact you? Maybe email...?
@emirhansoylu
@emirhansoylu 2 года назад
The *BEST* tutorial about Docker I've seen on RU-vid. I can't believe it's free. Thank you Sanjeev.
@VipulGoel86
@VipulGoel86 2 года назад
Best video ever I've watched, all real life development issues with clear explanation are mentioned and implemented with solutions...
@petermurutu5709
@petermurutu5709 3 года назад
God bless freecode camp💯
@Shpatak
@Shpatak Год назад
Thank you for this descriptive course! That's what I've been looking for a while! God bless you, mate!
@wforbes87
@wforbes87 2 года назад
This is like 20+ tutorials rolled into one cohesive project. Thanks and props to Sanjeev
@tanzimchowdhury320
@tanzimchowdhury320 2 года назад
For those of you who are watching this in 2022, for digital ocean, I would highly recommend mongo image 4.2.23-rc0-bionic. When I was trying it with the latest one (6) it kept getting killed. This was most probably due to the fact that the new mongo needs a lot more resources than just 1GB of ram.
@cagataysert1995
@cagataysert1995 2 года назад
I have just completed a Docker tutorial and I was looking for a hands on experience, so I am really happy to find your video. Thank you so much sir! Awesome job!
@react-with-nik
@react-with-nik 2 года назад
Best youtube video on node - docker. Simply amazing.
@TheZile24
@TheZile24 2 года назад
You are the best!!! This man deserves a medal.
@marslogics
@marslogics 3 года назад
Awesome job 👍. 1 more reason to separate out `npm install` is so that it is not needed to install node modules locally by collaborators.
@hussainmusthaq5070
@hussainmusthaq5070 3 года назад
Thank you so much for these tutorials. As a fresher, this is much more helpful for me being able to peek into the industry.
@jimshtepa5423
@jimshtepa5423 2 года назад
Thank you for showing several ways of doing same thing and explaining the pros and cons. E.g. inserting the hardcoded value of the ip to the connection string and as a more robust alternative using the name of the service
@bongumenzinzama6896
@bongumenzinzama6896 Год назад
Dude has the meanest api course on youtube🔥🔥🔥🔥
@alvinkariuki236
@alvinkariuki236 2 года назад
Incase you encounter Error return promise.reject(new errors_1.clientclosederror()); ^ clientclosederror: the client is closed Reason it occurs: The updated version of redis or node-redis has a particular issue with how we initialize our redis client Do the following 1. Update package.json to "redis": "3.0.0" 2. Stop your containers with the down command 3. Npm install 4. Restart your containers with --build and vuala
@matheusmarra8312
@matheusmarra8312 11 месяцев назад
Ty so much dude, I was stuck on this error
@madhank93
@madhank93 3 года назад
How they are able to read my mind 🙄 ? Thanks a lot
@guryashzone
@guryashzone 3 года назад
Because all human minds think the same :>
@UTube4075
@UTube4075 Месяц назад
Hey Sanjeev, this is the best for a noob like me. ❤❤
@piyushsarraf9994
@piyushsarraf9994 3 года назад
Bhai tu bhagwan hai thanks so much I was looking for this type of good tutorial since a long time
@kingcoder31aug
@kingcoder31aug 11 месяцев назад
Just Completed!! This course is great want more like this
@koolmo
@koolmo 2 месяца назад
Thanks for this golden tutorials
@alejandrosuarez239
@alejandrosuarez239 2 года назад
I think this is the best resource for beginners. Your are a grat teacher, thank you.
@el_conta
@el_conta Год назад
Standing applause!!! The best course! I'd give this 1000 likes if I could!
@christosmagkafas3947
@christosmagkafas3947 3 года назад
10/10 Thanks for providing valuable learning material.
@yashasaveekesarwani2551
@yashasaveekesarwani2551 Год назад
watched the whole course, everything works. I want to crush the like button!
@uubaidullah
@uubaidullah Год назад
guys make sure you have following packages versions t0 avoid redis session issues "connect-redis": "^6.1.3", "express": "^4.18.2", "express-session": "^1.17.3", To install these version: npm install connect-redis@6.1.3 npm install express@4.18.2 npm install express-session@1.17.3
@sososooosososososososososososo
you are my life saver. thnak you!
@react-with-nik
@react-with-nik 2 года назад
I'm following this tutorial since past 2 days. Can't belive this could turn out to be so good. I wanted to learn about load balancers. I thought I'll have to search for it on youtube, but you have already covered load balancers too. Please keep on teach devOps and also, please make videos on AWS CI/CD and AWS load balancers.
@joelmontano6562
@joelmontano6562 Год назад
a lesson in software engineering is realizing you don't know what you don't know...and I honestly didn't know the difference between nginx (didn't even know this existed) and express, thanks you for clarifying!
@Abdel-bw8qb
@Abdel-bw8qb 3 года назад
Omg guys they come with exact course at the exact time !!!!!!!!!!!!!!!!!!!!!
@syedmuhammaddanish8511
@syedmuhammaddanish8511 2 года назад
This one is the best and easiest tutorial to follow to learn docker. I can feel I am absorbing more and more knowledge with every minute of this video. God bless you bro
@haris7521
@haris7521 2 года назад
Amazing teacher, just mind blowing, explain every little details, this is a great lecture, thank you
@anindyabhattacharya4878
@anindyabhattacharya4878 2 года назад
Thank you so much, Sanjeev. Learned a lot. Just one small issue, .dockerignore does not ignore files in dev, as the dev has a bind mount and it gets copied over after being ignored. If bind-mount points to a different location in the container other than the work-dir then .dockerignore does its job.
@fortrolol
@fortrolol 9 месяцев назад
This is an amazing video! The best I've seen on this topic. Thanks a lot!
@misterjohn0011
@misterjohn0011 9 месяцев назад
Nice video! Learning docker with it. You can just use the production settings because you have a volume. Your local changes will overwrite your container node_modules. Remove "node_modules" from the local PC, then run "dev" container and receive an error: "nodemon not found"
@VIGILANTORX
@VIGILANTORX 8 месяцев назад
You are Great sanjeev! Thanks for an amazing tutorial on docker
@m.zainbutt3177
@m.zainbutt3177 2 года назад
If anyone is facing issue at 3:21:10, Redis Client closed. Please downgrade your Redis to version 3.1.0 like the video.
@ernestoalonso5565
@ernestoalonso5565 2 года назад
Hi! Thank you so much for the information, but how would it be in the image tag? like "redis:alpine3.16"? would that be corrrect?
@totung1736
@totung1736 2 года назад
Thanks Sanjeev and FCC a lot. Your course is brilliant and very helpful. Hope u the best!
@generalflowdeveloper
@generalflowdeveloper 3 года назад
Amazingly well-done tutorial.
@danilorg
@danilorg Год назад
2:33:00 I'm stuck here. For some reason I cannot find the module mongoose. I've no idea what to do. Tryed everything.
@user-wz3lh7xx5j
@user-wz3lh7xx5j 9 месяцев назад
he's a great teacher
@arv986
@arv986 2 года назад
Hi Sanjeev, Awesome tutorial Thanks for putting this together.
@andrewgrini5670
@andrewgrini5670 3 года назад
look, it is the very best tutorial on docker. Thank you, and wish you good luck!
@qtech6672
@qtech6672 3 года назад
Just finished this whole video while Coding along! Hope this learning process helps me get an offer! BTW, AWESOME video !!
@quanbuithanh6775
@quanbuithanh6775 3 года назад
Thank you so much for the tutorial with Docker & Docker compose. Very very useful for starting a devops. Waiting for the next section about CI/CD, thank you
@hellena_kar
@hellena_kar 3 года назад
Thank you, so fantastic job, explain everything on the easiest way
@sanjaybhan1585
@sanjaybhan1585 3 года назад
Crisp and clear 👌 thanks 😊
@kab791
@kab791 2 года назад
At 1:38 the if statement is unnecessary if you change the line before it to: COPY package*.json and then change RUN npm install to RUN npm ci, as long as the NODE_ENV is set to production it won’t install dev dependencies, otherwise it will. Note: you must not have package-lock.json in you dockerignore file
@nabeelyousafpasha
@nabeelyousafpasha 3 года назад
Bookmarked 🔖 for future. Someday in future i am gonna complete and implement
@abdulmalikabubakar4185
@abdulmalikabubakar4185 Год назад
This was explanatory and amazing. Thank you!!!
@felipejimenezortega7171
@felipejimenezortega7171 3 года назад
Great job!! Thanks Sanjeev for your help. I have a college assignment and I didn´t know where starts, and you helped so much understanding docker in a deep way so I can thinks by myself about what to do next and of course, use some of your code. Greetings from Chile :chile:
@yuno3364
@yuno3364 3 года назад
AMAZING COURSE here man. Great work
@imanqoly
@imanqoly 2 года назад
I wonder how more perfect a tutorial could be like... I am out of ideas ... awesome
@ibrahimjamil3155
@ibrahimjamil3155 2 года назад
next level explaination by sanjeev God bless you
@panjijayasutra1573
@panjijayasutra1573 2 года назад
This is absolutely help me alot, thank you very much for the great explanation..
@schaperot
@schaperot 3 года назад
Very nice course, evrything is well described and easy to understand !!!
@phucngo4062
@phucngo4062 3 года назад
This course help me alot! Thank you very much!
@xikote100
@xikote100 3 года назад
Muchas gracias por semejante dedicación y esfuerzo....
@lucasfonseca5111
@lucasfonseca5111 2 года назад
awesome!
@anishbishnoi29xD
@anishbishnoi29xD 3 года назад
Love from India ❤️
@StickmanProOfficial
@StickmanProOfficial 3 года назад
OMG after many months, bestest of all bests, do you have udemy or any other channel ? Would love to pay you for ur skills
@oneeminem2666
@oneeminem2666 3 года назад
Done till 53:19 Great Job Man Thanks
@mitejmadan8672
@mitejmadan8672 3 года назад
Edit: It is working now. I was not working because there was space inside the name of the folder eg. Web Devvelopment (1).I tried running %cd% commmand. only. It showed me that it was checking upto Web. It's 2:00 am. After the bath i had this eureka moment lol. Uptill now it is a great video. Thank you Sanjeev. The -v (volume) option is not working at my end. I tried several times it is not working. It is not auto saving. It tried to check the file using cat command. But it is not saving it.
@richardcasey4146
@richardcasey4146 3 года назад
If you have embedded spaces in your path name, just put quotes around the %cd%. Like so: docker run -v "%cd%":/app -p 3000:3000 -d --name node-app node-app-image This is a great tutorial!!
@mitejmadan8672
@mitejmadan8672 3 года назад
@@richardcasey4146 Oh thanks!! I didn't know this thing.
@ibrahimghasia1909
@ibrahimghasia1909 11 месяцев назад
What a great explanation. Keep doing the Good work
@yukselkapan9996
@yukselkapan9996 3 года назад
Amazing instructor! I have one question though, how does docker swarm and nginx load balancing work together? Does each swarm instance balance 2 node-apps?
@AmarKumar-od9gz
@AmarKumar-od9gz 3 года назад
Thank you very much seriously you nailed it . I'm subscribing you now.
@HP060
@HP060 3 года назад
Thanks for this great tutorial video. It really helped me.
@sanjitselvan5348
@sanjitselvan5348 Год назад
Thank you man! Very nice explanation
Далее
Docker Crash Course for Absolute Beginners [NEW]
1:07:39
100+ Docker Concepts you Need to Know
8:28
Просмотров 950 тыс.
So You Think You Know Git - FOSDEM 2024
47:00
Просмотров 1,1 млн
The intro to Docker I wish I had when I started
18:27
Docker Tutorial for Beginners
50:38
Просмотров 32 тыс.
Git Tutorial For Dummies
19:25
Просмотров 1,1 млн