Тёмный

What is Docker Compose? Multiple Containers & Docker Networking 

Monis Yousuf
Подписаться 1,1 тыс.
Просмотров 3,1 тыс.
50% 1

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
RU-vid: / @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

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

 

26 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 29   
@MonisYousuf
@MonisYousuf 4 месяца назад
Links to code examples, docker basics and timestamps: ____________________________________________________________ Basics of Docker: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-k29FmUcihSA.html 💻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 2 месяца назад
i already knew all of that, but subscribed anyway cus the video is just so well done. Keep up the high quality!
@ypathan420
@ypathan420 2 месяца назад
good presentation
@aimbrock
@aimbrock 3 месяца назад
Your content is really good. Much thanks.
@syafiighazali
@syafiighazali 4 месяца назад
Excellent explanation that cleared many doubts, can't wait for the next one!
@zdxzxzdxzx6780
@zdxzxzdxzx6780 3 месяца назад
This video is covers more concepts and much better than some pluralsight courses! Great job.
@marvhan888
@marvhan888 4 месяца назад
what a great work, Well done Monis
@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. 👍
@HasanAYousef
@HasanAYousef 4 месяца назад
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 4 месяца назад
Great stuff bro, thank you very much
@anbuarasanvellyan
@anbuarasanvellyan 3 месяца назад
Great work 🎉 awesome, May I know what tool you are using for these animations?
@MonisYousuf
@MonisYousuf 3 месяца назад
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!
@hyperoot
@hyperoot 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 ;)
@hyperoot
@hyperoot 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!
Далее
The Docker Bridge Network - Docker networks part 1
19:13
💋🧠
00:38
Просмотров 61 тыс.
Docker Compose networking basics
11:28
Просмотров 14 тыс.
Intro to Docker - Part 2 (Networking, Docker Compose)
32:52
100+ Docker Concepts you Need to Know
8:28
Просмотров 828 тыс.
Ultimate Docker Compose Tutorial
1:03:14
Просмотров 139 тыс.