Deploying the containerized application with Docker Compose || Docker Tutorial 12

TechWorld with Nana · Beginner ·☁️ DevOps & Cloud ·6y ago

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 What is Docker? Docker container concept explained || Docker Tutorial 1
What is Docker? Docker container concept explained || Docker Tutorial 1
TechWorld with Nana
2 What is a Docker Container? Docker Demo || Docker Tutorial 2
What is a Docker Container? Docker Demo || Docker Tutorial 2
TechWorld with Nana
3 How to install docker? Step by Step || Docker Tutorial 3
How to install docker? Step by Step || Docker Tutorial 3
TechWorld with Nana
4 8 Basic Docker Commands || Docker Tutorial 4
8 Basic Docker Commands || Docker Tutorial 4
TechWorld with Nana
5 Debugging Docker Containers with docker exec and docker logs || Docker Tutorial 5
Debugging Docker Containers with docker exec and docker logs || Docker Tutorial 5
TechWorld with Nana
6 Docker vs Virtual Machine | simply explained || Docker Tutorial 6
Docker vs Virtual Machine | simply explained || Docker Tutorial 6
TechWorld with Nana
7 Overview of Workflow with Docker - Docker in Practice || Docker Tutorial 7
Overview of Workflow with Docker - Docker in Practice || Docker Tutorial 7
TechWorld with Nana
8 Developing with Docker - Docker in Practice || Docker Tutorial 8
Developing with Docker - Docker in Practice || Docker Tutorial 8
TechWorld with Nana
9 Docker Compose Tutorial - Docker in Practice || Docker Tutorial 9
Docker Compose Tutorial - Docker in Practice || Docker Tutorial 9
TechWorld with Nana
10 Dockerfile Tutorial - Docker in Practice || Docker Tutorial 10
Dockerfile Tutorial - Docker in Practice || Docker Tutorial 10
TechWorld with Nana
11 Private Repository explained | Registry on AWS - Docker in Practice || Docker Tutorial 11
Private Repository explained | Registry on AWS - Docker in Practice || Docker Tutorial 11
TechWorld with Nana
12 Docker Volumes explained in 6 minutes
Docker Volumes explained in 6 minutes
TechWorld with Nana
Deploying the containerized application with Docker Compose || Docker Tutorial 12
Deploying the containerized application with Docker Compose || Docker Tutorial 12
TechWorld with Nana
14 Docker Volumes Demo || Docker Tutorial 13
Docker Volumes Demo || Docker Tutorial 13
TechWorld with Nana
15 Docker vs Kubernetes vs Docker Swarm | Comparison in 5 mins
Docker vs Kubernetes vs Docker Swarm | Comparison in 5 mins
TechWorld with Nana
16 What is Kubernetes | Kubernetes explained in 15 mins
What is Kubernetes | Kubernetes explained in 15 mins
TechWorld with Nana
17 Kubernetes Components explained! Pods, Services, Secrets, ConfigMap | Kubernetes Tutorial 14
Kubernetes Components explained! Pods, Services, Secrets, ConfigMap | Kubernetes Tutorial 14
TechWorld with Nana
18 Kubernetes Architecture explained | Kubernetes Tutorial 15
Kubernetes Architecture explained | Kubernetes Tutorial 15
TechWorld with Nana
19 Benefits of Kubernetes | Scalability, High Availability, Disaster Recovery | Kubernetes Tutorial 16
Benefits of Kubernetes | Scalability, High Availability, Disaster Recovery | Kubernetes Tutorial 16
TechWorld with Nana
20 Minikube and Kubectl explained | Setup for Beginners | Kubernetes Tutorial 17
Minikube and Kubectl explained | Setup for Beginners | Kubernetes Tutorial 17
TechWorld with Nana
21 Top 3 programming languages to learn in 2020 | meta analysis
Top 3 programming languages to learn in 2020 | meta analysis
TechWorld with Nana
22 Kubectl Basic Commands - Create and Debug Pod in a Minikube cluster | Kubernetes Tutorial 18
Kubectl Basic Commands - Create and Debug Pod in a Minikube cluster | Kubernetes Tutorial 18
TechWorld with Nana
23 Kubernetes YAML File Explained - Deployment and Service | Kubernetes Tutorial 19
Kubernetes YAML File Explained - Deployment and Service | Kubernetes Tutorial 19
TechWorld with Nana
24 Run Jenkins in Docker Container - Jenkins Pipeline Tutorial for Beginners 1/4
Run Jenkins in Docker Container - Jenkins Pipeline Tutorial for Beginners 1/4
TechWorld with Nana
25 Create Multibranch Pipeline with Git - Jenkins Pipeline Tutorial for Beginners 2/4
Create Multibranch Pipeline with Git - Jenkins Pipeline Tutorial for Beginners 2/4
TechWorld with Nana
26 Jenkinsfile - Jenkins Pipeline Tutorial for Beginners 3/4
Jenkinsfile - Jenkins Pipeline Tutorial for Beginners 3/4
TechWorld with Nana
27 Trigger Jenkins Build automatically - Jenkins Pipeline Tutorial for Beginners 4/4
Trigger Jenkins Build automatically - Jenkins Pipeline Tutorial for Beginners 4/4
TechWorld with Nana
28 Complete Application Deployment using Kubernetes Components | Kubernetes Tutorial 20
Complete Application Deployment using Kubernetes Components | Kubernetes Tutorial 20
TechWorld with Nana
29 Kubernetes Namespaces Explained in 15 mins | Kubernetes Tutorial 21
Kubernetes Namespaces Explained in 15 mins | Kubernetes Tutorial 21
TechWorld with Nana
30 Configure Build Tools in Jenkins and Jenkinsfile | Jenkins Tutorial
Configure Build Tools in Jenkins and Jenkinsfile | Jenkins Tutorial
TechWorld with Nana
31 Complete Jenkins Pipeline Tutorial | Jenkinsfile explained
Complete Jenkins Pipeline Tutorial | Jenkinsfile explained
TechWorld with Nana
32 Kubernetes Ingress Tutorial for Beginners | simply explained  | Kubernetes Tutorial 22
Kubernetes Ingress Tutorial for Beginners | simply explained | Kubernetes Tutorial 22
TechWorld with Nana
33 What is Helm in Kubernetes? Helm and Helm Charts explained  | Kubernetes Tutorial 23
What is Helm in Kubernetes? Helm and Helm Charts explained | Kubernetes Tutorial 23
TechWorld with Nana
34 How Websites Work | simply explained with examples
How Websites Work | simply explained with examples
TechWorld with Nana
35 What is JavaScript? | JavaScript Tutorial #1
What is JavaScript? | JavaScript Tutorial #1
TechWorld with Nana
36 What is Ansible | Ansible Playbook explained | Ansible Tutorial for Beginners
What is Ansible | Ansible Playbook explained | Ansible Tutorial for Beginners
TechWorld with Nana
37 JavaScript Variables & JavaScript Data Types explained | JavaScript Tutorial #2
JavaScript Variables & JavaScript Data Types explained | JavaScript Tutorial #2
TechWorld with Nana
38 How Prometheus Monitoring works | Prometheus Architecture explained
How Prometheus Monitoring works | Prometheus Architecture explained
TechWorld with Nana
39 Where to write JavaScript | Where to execute JavaScript Code | JavaScript Tutorial #3
Where to write JavaScript | Where to execute JavaScript Code | JavaScript Tutorial #3
TechWorld with Nana
40 JavaScript Operators & JavaScript Conditionals | JavaScript Tutorial #4
JavaScript Operators & JavaScript Conditionals | JavaScript Tutorial #4
TechWorld with Nana
41 Pods and Containers - Kubernetes Networking | Container Communication inside the Pod
Pods and Containers - Kubernetes Networking | Container Communication inside the Pod
TechWorld with Nana
42 Kubernetes Volumes explained | Persistent Volume, Persistent Volume Claim & Storage Class
Kubernetes Volumes explained | Persistent Volume, Persistent Volume Claim & Storage Class
TechWorld with Nana
43 Kubernetes ConfigMap and Secret as Kubernetes Volumes | Demo
Kubernetes ConfigMap and Secret as Kubernetes Volumes | Demo
TechWorld with Nana
44 Pull Image from Private Docker Registry in Kubernetes cluster | Demo
Pull Image from Private Docker Registry in Kubernetes cluster | Demo
TechWorld with Nana
45 Kubernetes StatefulSet simply explained | Deployment vs StatefulSet
Kubernetes StatefulSet simply explained | Deployment vs StatefulSet
TechWorld with Nana
46 Yaml Tutorial | Learn YAML in 18 mins
Yaml Tutorial | Learn YAML in 18 mins
TechWorld with Nana
47 Terraform explained in 15 mins | Terraform Tutorial for Beginners
Terraform explained in 15 mins | Terraform Tutorial for Beginners
TechWorld with Nana
48 Setup Prometheus Monitoring on Kubernetes using Helm and Prometheus Operator | Part 1
Setup Prometheus Monitoring on Kubernetes using Helm and Prometheus Operator | Part 1
TechWorld with Nana
49 Managed Kubernetes Cluster explained | Kubernetes on Cloud (1/2)
Managed Kubernetes Cluster explained | Kubernetes on Cloud (1/2)
TechWorld with Nana
50 Step by Step Application Deployment on LKE using Helm | Kubernetes on Cloud (2/2)
Step by Step Application Deployment on LKE using Helm | Kubernetes on Cloud (2/2)
TechWorld with Nana
51 Kubernetes Operator simply explained in 10 mins
Kubernetes Operator simply explained in 10 mins
TechWorld with Nana
52 What is Infrastructure as Code? Difference of Infrastructure as Code Tools
What is Infrastructure as Code? Difference of Infrastructure as Code Tools
TechWorld with Nana
53 AWS EKS - Create Kubernetes cluster on Amazon EKS | the easy way
AWS EKS - Create Kubernetes cluster on Amazon EKS | the easy way
TechWorld with Nana
54 Prometheus Monitoring - Steps to monitor third-party apps using Prometheus Exporter | Part 2
Prometheus Monitoring - Steps to monitor third-party apps using Prometheus Exporter | Part 2
TechWorld with Nana
55 GitHub Actions Tutorial - Basic Concepts and CI/CD Pipeline with Docker
GitHub Actions Tutorial - Basic Concepts and CI/CD Pipeline with Docker
TechWorld with Nana
56 Docker Tutorial for Beginners [FULL COURSE in 3 Hours]
Docker Tutorial for Beginners [FULL COURSE in 3 Hours]
TechWorld with Nana
57 Kubernetes Services explained | ClusterIP vs NodePort vs LoadBalancer vs Headless Service
Kubernetes Services explained | ClusterIP vs NodePort vs LoadBalancer vs Headless Service
TechWorld with Nana
58 Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]
Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]
TechWorld with Nana
59 Containers on AWS Overview: ECS | EKS | Fargate | ECR
Containers on AWS Overview: ECS | EKS | Fargate | ECR
TechWorld with Nana
60 Kubernetes is dropping Docker support - What does it mean for YOU?
Kubernetes is dropping Docker support - What does it mean for YOU?
TechWorld with Nana

Related AI Lessons

Up next
Containers on Amazon ECS with Mama J
AWS Developers
Watch →