What is Docker Compose? Multiple Containers & Docker Networking

  Рет қаралды 2,957

Monis Yousuf

Monis Yousuf

Күн бұрын

Docker - Running Multiple Containers using Docker Compose & Docker Networking
#softwareengineering #docker #devops
In this video, we talk about how we can spawn multiple docker containers and make them interact with each other through basic docker networking. A docker compose file enables us to pack the configuration of multiple containers in one place and enables us to build multiple images, their network and containers.
New to Docker? Learn about the basics: • What is Docker? Docker...
Code Examples from this video: github.com/monisyousuf/youtub...
Timestamps:
00:00 Intro
00:47 Multi Service Applications
03:22 What is docker compose?
06:16 Running Multiple Containers
09:13 Docker Networking
12:29 Handling Dependencies
14:06 What's Next?
Instagram: @monis.yousuf
LinkedIn: / monis-yousuf
Twitter: / monisyousuf
KZbin: / @monisyousuf
My Website: monisyousuf.com
My Gear:
Camera: amzn.to/3CaaLbJ
Lens: amzn.to/3Naj39I
Lights: amzn.to/42mnKBB
Microphone: amzn.to/3OYyUcH
Laptop: amzn.to/440kEoj
Keyboard: amzn.to/3WN41Kj
Workdesk: amzn.to/43nAE3G

Пікірлер: 29
@MonisYousuf
@MonisYousuf 4 ай бұрын
Links to code examples, docker basics and timestamps: ____________________________________________________________ Basics of Docker: kzbin.info/www/bejne/oWOcd6CLmM6biaM 💻Code Examples from this video: github.com/monisyousuf/youtube-tutorials/tree/main/CD_007_docker_2 ######### Timestamps: ######### 00:00 Intro 00:47 Multi Service Applications 03:22 What is docker compose? 06:16 Running Multiple Containers 09:13 Docker Networking 12:29 Handling Dependencies 14:06 What's Next?
@lolikpof
@lolikpof Ай бұрын
i already knew all of that, but subscribed anyway cus the video is just so well done. Keep up the high quality!
@aimbrock
@aimbrock 2 ай бұрын
Your content is really good. Much thanks.
@zdxzxzdxzx6780
@zdxzxzdxzx6780 2 ай бұрын
This video is covers more concepts and much better than some pluralsight courses! Great job.
@syafiighazali
@syafiighazali 4 ай бұрын
Excellent explanation that cleared many doubts, can't wait for the next one!
@Afrolatina_adventurer
@Afrolatina_adventurer 3 ай бұрын
I cant wait to see your next video! these are masterpieces
@rolandschatzle4208
@rolandschatzle4208 3 ай бұрын
Good video! All the concepts are well explained. 👍
@marvhan888
@marvhan888 3 ай бұрын
what a great work, Well done Monis
@ypathan420
@ypathan420 Ай бұрын
good presentation
@HasanAYousef
@HasanAYousef 3 ай бұрын
great tutorial @Monis, thanks a lot.
@VaibhavShewale
@VaibhavShewale 4 ай бұрын
ooh man need more of this also fast cause i have interview on this XD
@MonisYousuf
@MonisYousuf 4 ай бұрын
I don't know whether this comment should make me happy or sad :D
@VaibhavShewale
@VaibhavShewale 4 ай бұрын
@@MonisYousuf the one motivate you dude😎 Also how ya make those edits? Seems amazing
@MonisYousuf
@MonisYousuf 4 ай бұрын
Thank you! I use Final Cut Pro with some creativity :)
@codex8797
@codex8797 3 ай бұрын
Great stuff bro, thank you very much
@anbuarasanvellyan
@anbuarasanvellyan 2 ай бұрын
Great work 🎉 awesome, May I know what tool you are using for these animations?
@MonisYousuf
@MonisYousuf 2 ай бұрын
I use Final Cut Pro
@oleksiiprykhodko517
@oleksiiprykhodko517 3 ай бұрын
In the "yaml" file you can create a service and configure a name for its container with the container_name command. When we create a container with a given database and a container with a backend, what name should we give in the connection string (service name or container name)?
@MonisYousuf
@MonisYousuf 3 ай бұрын
Either one can be used. Both will work.
@oleksiiprykhodko517
@oleksiiprykhodko517 3 ай бұрын
@@MonisYousuf Great job. Thank you for your work. I'm sure with such cool animations you will have many subscribers
@MonisYousuf
@MonisYousuf 3 ай бұрын
Thank you so much!
@hyp3r00t
@hyp3r00t 4 ай бұрын
Hey, Monis. I have a couple of questions. I hope you have some time to address those. 1. You "apps" seems completely developed where one can directly build it and deploy it (which you will explain in the next video). But generally, app development is never finished and we need to continuously make changes. Now, if there is only one developer, it's alright as we can simply make changes in the local and the `--build` flag will recreate the docker image. However, for a team working on the same project and/or if there are multiple branches of the code (prod, dev, test, etc.), can we leverage docker-compose to keep things streamlined? 2. vscode has a feature named dev-containers. This is great because I can create container and share that with anyone who want to develop with the tools and versions that I am using. They won't have to setup anything. They can run the container and have an exact replica of my dev environment. I am having hard time figuring out how to setup dev-containers for each segment of an app (frontend, backend, and DB for instance) that can communicate with each other while in the development phase. 3. At 7:44 you mentioned that we can provide environment variables into the docker-compose. I don't think it is secure at all as I can read the docker-compose file you have shared in the GitHub repo. How can I keep it safe? Is the only way to keep it secure is not to share the actual docker-compose file rather a censored version of it? I am fascinated by DevOps and SecDevOps but I have very limited technical knowledge. If my queries doesn't make sense, let me know. I will try to clarify on what I mean by these questions. Thanks for the all the efforts and videos. I look forward to the next one. I have one potential question regarding the content of the next video as well. Are we going to see IaaS where we deploy it within, let's say, AWS EC2 instance where we potentially have more control over the system or are we just planning to explore the SaaS version of this in AWS aka AWS ECS? Perhaps, you could show a contrast between these. (Just a suggestion) Basically, are we trying to outsource the job of the DevOps team to AWS or are we leveraging the features of cloud computing while retaining the control over the system and have our own DevOps team? Cheers, HYP3R00T
@MonisYousuf
@MonisYousuf 4 ай бұрын
Sure :) 1. Docker Compose is more geared towards local development. Where you can make changes (let's say just backend and database). Run docker-compose up and see the results while in development phase. However - in reality, on higher environments you won't usually use docker compose. If we take this example - your backend, frontend and database would most likely be hosted in different types of cloud infrastructure (e.g. you'd have a FE cluster, a BE cluster, a DB cluster and so on). For each of these clusters - you also need to manage versions. Usually your CI/CD pipeline builds an image in one step, tags it with a version and pushes it to a private docker registry. Thereafter, in another step the latest image would be pulled into the server(s) and deployed. And you would have to maintain different docker image versions for frontend, backend (and probably other downstream microservices). Maybe your frontend underwent 20 changes since the time it went live (image version: v0.20) and your backend only underwent 10 (image version: v10). Similarly - it could also get counter-productive in higher environments to intertwine these versions and then run all of them up on the same instance via docker-compose. 2) To your question "I am having hard time figuring out how to setup dev-containers for each segment of an app (frontend, backend, and DB for instance) that can communicate with each other while in the development phase". -- You just need to run the docker compose up. If you need to make changes, change the code, re-run docker compose with --build. This will automatically create the containers and the network for these apps on your local environments. Your colleagues will be able to replicate this in the same way. 3) True, setting up environment variables in the docker-compose file is not the best practice. It was added for the sake of simplicity and for local development. In reality - it depends on the sensitivity of the value of environment variables. Some environment variables and not sensitive (e.g. an environment variable for a public URL which is added for standardisation and making it less error-prone). And depending on where they are used (app or instance level), they can be added in docker's .env files, build pipeline or an orchestration engine like Kubernetes. However - for environment variables that are secret (Database Passwords, Keys and such) and are on higher environments, should never be in cleartext, nor should they be in compose files or environment files. For that, as a best practice we should use a credential store. For the next video - we'll, you'll have to wait for it ;)
@hyp3r00t
@hyp3r00t 4 ай бұрын
@@MonisYousuf ❤Thanks for responding. Can't wait for the next video.
@santosh-panigrahi
@santosh-panigrahi 4 ай бұрын
Super. I have one question here how backend will know database started , what condition we have to mention in docker compose file. and follow up is what software you are using to develop these type of content with animation. Thank you
@MonisYousuf
@MonisYousuf 4 ай бұрын
At 13:34 - we specify that the backend app depends on the database on the condition that the service should be started (service_started). This option is the default option simply waits for the container to be "started" and will not check the internal status of the service if the container has successfully started. For this reason, this option doesn't require anything "extra" to be defined in the backend_database. Since our database image is very fast and we're not doing a lot of customisations there - it shouldn't be a problem. I use Final Cut Pro
@santosh-panigrahi
@santosh-panigrahi 4 ай бұрын
Got it. Thank you
@mominyousuf6432
@mominyousuf6432 4 ай бұрын
Great work man!
@MonisYousuf
@MonisYousuf 4 ай бұрын
Thank you!
Terraform vs. Crossplane vs. Ansible - Rivals or Allies?
16:26
DevOps Toolkit
Рет қаралды 10 М.
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 33 МЛН
Заметили?
00:11
Double Bubble
Рет қаралды 3,4 МЛН
He tried to save his parking spot, instant karma
00:28
Zach King
Рет қаралды 21 МЛН
Docker Compose with .NET 8, PostgreSQL, and Redis (step by step)
13:41
Milan Jovanović
Рет қаралды 34 М.
What is Docker? Docker File, Docker Image & Docker Container
12:25
Monis Yousuf
Рет қаралды 12 М.
Inside DOCKER | Exploring Namespaces, cgroups, and more!
21:03
headintheclouds
Рет қаралды 1,2 М.
This Docker Compose UI is amazing! //Dockge Tutorial
13:08
Christian Lempa
Рет қаралды 92 М.
The Docker Bridge Network - Docker networks part 1
19:13
OneMarcFifty
Рет қаралды 34 М.
Ultimate Docker Compose Tutorial
1:03:14
TechWorld with Nana
Рет қаралды 130 М.
100+ Docker Concepts you Need to Know
8:28
Fireship
Рет қаралды 790 М.
Docker Networking Crash Course
49:19
Hussein Nasser
Рет қаралды 76 М.
Docker - Communicate between containers
17:46
Tobi's Developer Corner
Рет қаралды 26 М.
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 33 МЛН