Deploying the containerized application with Docker Compose || Docker Tutorial 12
Skills:
Docker & Containers90%
Key Takeaways
Deploys a containerized application with Docker Compose
Full Transcript
so in this video we're gonna see how to deploy an application that we built into a docker image so after you package your application in a docker image and save it in the private repository you need to somehow deploy it on a development server or integration server or whatever other environment in this specific video we are using a docker registry of Amazon Web Services called ECR that's where we have pushed our own application docker image and we're gonna use docker compose to deploy that application this video is part of a docker tutorial series so if you want to actually follow through the whole process of developing an application packaging it into a docker image pushing it into a private repository and then finally deploying it on a application server here's a link to the video series so you can check that out so again back to our initial overview we have gone through all these individual steps so we built an image just like a Jenkins server would do and we pushed it into a repository so now let's actually simulate a development environment so let's imagine we have logged into a development server and we want to run our image that we just pushed the repository so our my app image and the MongoDB image both the database in the Express on the development server so the my app image will be pulled from private repository of EWS the in the to containers will be pulled from the docker hub so let's see actually how that would work so usually again you have developed your application you're done with it and you have created your own docker image right now in order to start an application on development server you would need all the containers that make up that application environment okay so we have a longer Express already so what we are going to do is here we're gonna add a new container in the list which is gonna be our own image so let's go ahead and copy the image from our repository so let's actually use the 1.0 so again remember we said that this image name is a shortcut for having a docker dot IO dot library slash with like a specific version so instead of that because we are pulling these images from a docker hub we can actually skip that repository domain in front of the images but here because we're pulling it from a private repository so if we were to specify our image like this docker will think that our image resides on docker hub so we try to pull it from docker hub and of course it won't find it because we have to tell docker go and look at this repository with this repository name in this tag and of course in order to be able to pull this image or the docker composed to be able to pull this image the environment where you're executing this docker compose file has to be logged into a docker repository so here as the development server has to pull the image from the repository what we would need to do on the development server is actually do a docker login before we execute the docker compose and obviously you don't need a doctor login for doc hub those images will be pulled freely ok so the next thing that we have to configure are the ports because obviously want to open the ports if we go back we see that our application runs on port 3000 so the port of the container or that where the container is listening on is 3000 and here we can open the port on the host machine so it's going to be 3000 map to 3000 we have actually the environment variables inside of the docker file but obviously we could have configured them in the docker compose just like this so it's an alternative so this will be a complete docker compose file that will be used on a development server to deploy all the all the applications inside so again if we're trying to simulate a development server that the first step will be to dock to the docker login in this case you have this on command for logging in to the AWS repository which I have done already in this terminal so the next step is to have the docker compose file available on this development server because we have to execute the docker compose file because we're simulating here the way I would do it is I'm gonna create an demo file in the current directory where I am I'm gonna copy this and save so now I have my ml file and now we can start all three containers using munger docker compose comment - eff up and here we see that app started on 3000 and MongoDB and Express started as well so let's check again now and here we saw that database is lost every time we recreate a container and of course that's not good and we're going to learn how to preserve the database data between the container restarts using docker volumes in the later tutorials because this is not an ideal State okay so now that we have database in a collection let's actually refresh in our application works as well let's check awesome so our application works let's refresh this one as well and there is actually one thing that I needed to change in the code to connect no J's with MongoDB so let's actually go and look at that so this is my these are my handlers you know no J's where I connect to the MongoDB database so the your eyes are the same and what I changed here is that it was a localhost before so instead of localhost I changed it to MongoDB because this actually is a name of the container or of the service that we specify here so this actually leads back to the doctor Network and how docker compose takes care of it is that in the URI or when I connect one application in a docker container with another one in an other docker container I don't have to use this localhost anymore actually I wouldn't even need to use the port even because I have all that information so the host name and the port number in that configuration so my application will be able to connect to MongoDB using the service name and because of that you don't have to specify here a localhost and the port number which is actually even more advantage when you consider using docker containers to run all of your applications because it makes the connectivity between them even more easier and that actually concludes the this diagram that we saw previously we have gone through all of the steps where we saw how to develop a JavaScript application locally with docker containers then we saw how to build them into an image just like continuous integration build we'll do it then we pushed it into a private repository and we simulated a development server where we pull the image from private repository and the other images from the docker hub where we started the whole application set up with our own application in the two applications using a docker compose which is how you would deploy an application on a dev server so that now testers or other developers will be able to access the development server and actually try out the application that you just deployed or you can also use it for demos thanks for watching the video I hope it was helpful and if it was don't forget to like it this is a video series so I will create a new one every week so if you want to be notified whenever a new video comes out then subscribe to my channel if you have any questions if something wasn't clear in the video please post them in a comment section below and I will try to answer them so thank you and see you in the next video
Original Description
How to deploy your containerized application with Docker Compose.
In this video I show how to deploy an application, which we built before in a docker image. So, after you package your application in a docker image and save it in a private repository you need to deploy it on some server. In this video I use docker compose to deploy the application.
This is the last video of the "Docker in Practice" video series:
Developing with Docker ► https://youtu.be/6YisG2GcXaw
Docker Compose ► https://youtu.be/MVIcrmeV_6c
Dockerfile ► https://youtu.be/WmcdMiyqfZs
Private Repository ► https://youtu.be/vWSRWpOPHws
Deploy your containerized Application ► https://youtu.be/ZowjOhpAcIc
You can check out my videos for the Pre-Requisites:
✅ Basic Docker Concepts: https://youtu.be/GeqaTjKMWeY
✅ Basic Commands: https://youtu.be/xGn7cFR3ARU
For any questions/issues/feedback, please leave me a comment and I will get back to you as soon as possible.
►► Full Docker and Kubernetes Tutorial Playlist: https://bit.ly/2YGeRp9
This video is the 12th of a complete series for beginners, where I explain the basic concepts and also show you demo's like deploying your containerized application. At the end of this tutorial you will fully understand Docker and Kubernetes.
💡 Only interested in Docker?
►► Complete Docker Tutorial Playlist: https://bit.ly/2ymJHbX
#docker #dockertutorials #devops #techworldwithnana
-------------------------------------------------------------------------------------
The complete step-by-step guide to Docker and Kubernetes will include the following content:
🐳 D O C K E R
- Container concept
- Why docker? (image vs. traditional DevOps)
- Install docker on different operating systems
- 8 basic commands you need to know
- Docker vs. Virtual Machine
- Docker in
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from TechWorld with Nana · TechWorld with Nana · 13 of 60
1
2
3
4
5
6
7
8
9
10
11
12
▶
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
What is Docker? Docker container concept explained || Docker Tutorial 1
TechWorld with Nana
What is a Docker Container? Docker Demo || Docker Tutorial 2
TechWorld with Nana
How to install docker? Step by Step || Docker Tutorial 3
TechWorld with Nana
8 Basic Docker Commands || Docker Tutorial 4
TechWorld with Nana
Debugging Docker Containers with docker exec and docker logs || Docker Tutorial 5
TechWorld with Nana
Docker vs Virtual Machine | simply explained || Docker Tutorial 6
TechWorld with Nana
Overview of Workflow with Docker - Docker in Practice || Docker Tutorial 7
TechWorld with Nana
Developing with Docker - Docker in Practice || Docker Tutorial 8
TechWorld with Nana
Docker Compose Tutorial - Docker in Practice || Docker Tutorial 9
TechWorld with Nana
Dockerfile Tutorial - Docker in Practice || Docker Tutorial 10
TechWorld with Nana
Private Repository explained | Registry on AWS - Docker in Practice || Docker Tutorial 11
TechWorld with Nana
Docker Volumes explained in 6 minutes
TechWorld with Nana
Deploying the containerized application with Docker Compose || Docker Tutorial 12
TechWorld with Nana
Docker Volumes Demo || Docker Tutorial 13
TechWorld with Nana
Docker vs Kubernetes vs Docker Swarm | Comparison in 5 mins
TechWorld with Nana
What is Kubernetes | Kubernetes explained in 15 mins
TechWorld with Nana
Kubernetes Components explained! Pods, Services, Secrets, ConfigMap | Kubernetes Tutorial 14
TechWorld with Nana
Kubernetes Architecture explained | Kubernetes Tutorial 15
TechWorld with Nana
Benefits of Kubernetes | Scalability, High Availability, Disaster Recovery | Kubernetes Tutorial 16
TechWorld with Nana
Minikube and Kubectl explained | Setup for Beginners | Kubernetes Tutorial 17
TechWorld with Nana
Top 3 programming languages to learn in 2020 | meta analysis
TechWorld with Nana
Kubectl Basic Commands - Create and Debug Pod in a Minikube cluster | Kubernetes Tutorial 18
TechWorld with Nana
Kubernetes YAML File Explained - Deployment and Service | Kubernetes Tutorial 19
TechWorld with Nana
Run Jenkins in Docker Container - Jenkins Pipeline Tutorial for Beginners 1/4
TechWorld with Nana
Create Multibranch Pipeline with Git - Jenkins Pipeline Tutorial for Beginners 2/4
TechWorld with Nana
Jenkinsfile - Jenkins Pipeline Tutorial for Beginners 3/4
TechWorld with Nana
Trigger Jenkins Build automatically - Jenkins Pipeline Tutorial for Beginners 4/4
TechWorld with Nana
Complete Application Deployment using Kubernetes Components | Kubernetes Tutorial 20
TechWorld with Nana
Kubernetes Namespaces Explained in 15 mins | Kubernetes Tutorial 21
TechWorld with Nana
Configure Build Tools in Jenkins and Jenkinsfile | Jenkins Tutorial
TechWorld with Nana
Complete Jenkins Pipeline Tutorial | Jenkinsfile explained
TechWorld with Nana
Kubernetes Ingress Tutorial for Beginners | simply explained | Kubernetes Tutorial 22
TechWorld with Nana
What is Helm in Kubernetes? Helm and Helm Charts explained | Kubernetes Tutorial 23
TechWorld with Nana
How Websites Work | simply explained with examples
TechWorld with Nana
What is JavaScript? | JavaScript Tutorial #1
TechWorld with Nana
What is Ansible | Ansible Playbook explained | Ansible Tutorial for Beginners
TechWorld with Nana
JavaScript Variables & JavaScript Data Types explained | JavaScript Tutorial #2
TechWorld with Nana
How Prometheus Monitoring works | Prometheus Architecture explained
TechWorld with Nana
Where to write JavaScript | Where to execute JavaScript Code | JavaScript Tutorial #3
TechWorld with Nana
JavaScript Operators & JavaScript Conditionals | JavaScript Tutorial #4
TechWorld with Nana
Pods and Containers - Kubernetes Networking | Container Communication inside the Pod
TechWorld with Nana
Kubernetes Volumes explained | Persistent Volume, Persistent Volume Claim & Storage Class
TechWorld with Nana
Kubernetes ConfigMap and Secret as Kubernetes Volumes | Demo
TechWorld with Nana
Pull Image from Private Docker Registry in Kubernetes cluster | Demo
TechWorld with Nana
Kubernetes StatefulSet simply explained | Deployment vs StatefulSet
TechWorld with Nana
Yaml Tutorial | Learn YAML in 18 mins
TechWorld with Nana
Terraform explained in 15 mins | Terraform Tutorial for Beginners
TechWorld with Nana
Setup Prometheus Monitoring on Kubernetes using Helm and Prometheus Operator | Part 1
TechWorld with Nana
Managed Kubernetes Cluster explained | Kubernetes on Cloud (1/2)
TechWorld with Nana
Step by Step Application Deployment on LKE using Helm | Kubernetes on Cloud (2/2)
TechWorld with Nana
Kubernetes Operator simply explained in 10 mins
TechWorld with Nana
What is Infrastructure as Code? Difference of Infrastructure as Code Tools
TechWorld with Nana
AWS EKS - Create Kubernetes cluster on Amazon EKS | the easy way
TechWorld with Nana
Prometheus Monitoring - Steps to monitor third-party apps using Prometheus Exporter | Part 2
TechWorld with Nana
GitHub Actions Tutorial - Basic Concepts and CI/CD Pipeline with Docker
TechWorld with Nana
Docker Tutorial for Beginners [FULL COURSE in 3 Hours]
TechWorld with Nana
Kubernetes Services explained | ClusterIP vs NodePort vs LoadBalancer vs Headless Service
TechWorld with Nana
Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]
TechWorld with Nana
Containers on AWS Overview: ECS | EKS | Fargate | ECR
TechWorld with Nana
Kubernetes is dropping Docker support - What does it mean for YOU?
TechWorld with Nana
More on: Docker & Containers
View skill →Related AI Lessons
🎓
Tutor Explanation
DeepCamp AI