SlideShare a Scribd company logo
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 1
This documentation explains step by step how to Build, Deploy and Run Node.js application on
Azure using docker.
The following Source code will be used as test and can be checked from here.
Requirements:-
• Azure Account (Sign up for a free $200 credit)
• Git (Install on the computer)
• Docker (Install on the computer)
• Node.js (you can use the above link to clone the code).
Let’s work !!!
Step #1:-
After logging to the Azure account, as initial step we must create something called container
registry ( ACR will be used later as refer to Azure container Registry) which allows you to store
your custom container images privately in the Azure cloud.
Access to azure portal from the following link :- https://portal.azure.com/
Figure 1 Create container Registry
Then After access the container registry page, press add
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 2
Figure 2 add ACR Screen
And fill the information depends on the requirement you have.
Figure 3 Create ACR
And Press create.
Wait for couple of second/minute till it will be created, azure will notify you (Notification
section) once it’s completed.
Step #2:-
Once the ACR will be created, press on it, and it will take you to the information about the
created ACR, the following information will be needed later.
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 3
Figure 4 ACR Login information
Step #3:-
We need to check the docker login, open Power shell/terminal depends on operating system
you are using, to authenticate to ACR and validate the credentials.
Figure 5 Test docker Login using ACR information
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 4
Figure 6 Test Result, Login Succeeded
You should see a message that says, “login succeeded”. As Figure 6.
Step #4:-
We need to clone the sample code from
https://bitbucket.org/network-international/node-js-getting-started/src/master/
Git command should be installed, to do this just press on this link here.
Fire the below command on the PowerShell/terminal/command promote.
git clone https://github.com/heroku/node-js-getting-started.git
Figure 7 Using Git to clone the code
After you've cloned the repo, switch into the application directory:
You will find files, create file call it Dockerfile (without any extension).
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 5
Figure 8 Dockerfile inside cloned repo
Inside the file write the following :-
Descriptions : -
• FROM node:alpine, The FROM command defines the base container image, and the
operating system will be Alpine Linux.
• WORKDIR /usr/app define the working directory and is where we'll store the application
code and if it’s not exists on the OS will be created during the process.
• COPY package*.json ./ used during the build process to add the package.json and
package-lock.json files to the working directory.
• RUN npm install used to execute npm install which will ensure our application
dependencies are included within the container image.
• COPY . . this is to copy the application source files into the working directory.
• CMD ["npm", "start"] defines the default command to execute when the container
starts.
Step #5:-
To do this step, you should be in the same directory as the Dockerfile. Use the docker build
command to create your container image, the below command will tell Docker to build your
image using the Dockerfile in the current directory.
FROM node:alpine
WORKDIR /usr/app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["npm", "start"]
docker build -t demonetwork.azurecr.io/node-docker-demo:latest .
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 6
Figure 9 Build docker image using dockerfile
Step #6:-
Now we test the login to our docker before, let’s push our image to ACR using the below
command,
Figure 10 Push the docker Image to ACR
docker push demonetwork.azurecr.io/node-docker-demo:latest
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 7
Figure 11 Pushing the docker image completed
After the command completes successfully, you can head back to the Azure portal to verify that
your image is now available in ACR.
Figure 12 Verify the command
Step #7:-
The final step, which is expose the docker application using URL, Azure make this step easy, by
creating resource called Web App for containers, to do this just follow the below figures.
In the Azure portal, select Create a resource, select Web in the Azure Marketplace, and choose
Web App for containers.
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 8
Figure 13 Create web app for containers
Press on web app for containers
Figure 14 Create Web App for containers
New page will be open, fill the information, such as the name of instance, will be publish either
on Linux or docker container ( our case) , don’t press review + create, press Next: Docker, so you
will be able to configure the web app.
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 9
Figure 15 Web App Instance details
The next screen, which is docker, as you see, I choose “ azure container Registry” and from the
drop list, will be appeared our options.
Figure 16 web app container configuration
Press review creates.
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 10
Figure 17 Web App Summary Page
Wait for couple of seconds and it will be created.
Figure 18 Final Result with URL for the new deployed code
As you see if you check the URL and press on it
This is the result.
https://networktask.azurewebsites.net
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa P a g e | 11

More Related Content

What's hot (17)

DOCX
SELENIUM SCRIPTS FOR DASHBOARD UI
Manasa Dilipkumar
 
PPTX
Java – azure integration
pramajaya
 
PDF
New features of Azure Cloud Provider in OpenShift Container Platform 3.10
Takayoshi Tanaka
 
PPTX
Setup a Dev environment that feels like $HOME on Windows 10
Stefan Scherer
 
PDF
Troubleshooting EC2- Linux Server Configuration
ArchanaDeviKapaliVij
 
PDF
SDAccel Design Contest: How to use SDAccel on AWS
NECST Lab @ Politecnico di Milano
 
PPTX
15-ways-to-optimize-spring-boot-for-the-cloud
Billy Korando
 
PPTX
Unity and Azure Mobile Services using Prime31 plugin
David Douglas
 
PDF
Jenkins Setup Document
mobi fly
 
PPTX
15 ways-to-optimize-spring-boot-for-the-cloud
PolyglotMeetups
 
PDF
Ionic2
Jiayun Zhou
 
PDF
New features of Azure Cloud Provider at OCP 3.10
Takayoshi Tanaka
 
PDF
ApppiumDoc_version2015
Amit DEWAN
 
PDF
Midas - on-the-fly schema migration tool for MongoDB.
Dhaval Dalal
 
PPTX
Docker on Windows - 101 to Production (half-day workshop)
Elton Stoneman
 
PPTX
"Don’t Run with Scissors: Serverless Security Survival Guide" | Hillel Solow,...
LCloud
 
PPT
Php ppt
ankitankesh
 
SELENIUM SCRIPTS FOR DASHBOARD UI
Manasa Dilipkumar
 
Java – azure integration
pramajaya
 
New features of Azure Cloud Provider in OpenShift Container Platform 3.10
Takayoshi Tanaka
 
Setup a Dev environment that feels like $HOME on Windows 10
Stefan Scherer
 
Troubleshooting EC2- Linux Server Configuration
ArchanaDeviKapaliVij
 
SDAccel Design Contest: How to use SDAccel on AWS
NECST Lab @ Politecnico di Milano
 
15-ways-to-optimize-spring-boot-for-the-cloud
Billy Korando
 
Unity and Azure Mobile Services using Prime31 plugin
David Douglas
 
Jenkins Setup Document
mobi fly
 
15 ways-to-optimize-spring-boot-for-the-cloud
PolyglotMeetups
 
Ionic2
Jiayun Zhou
 
New features of Azure Cloud Provider at OCP 3.10
Takayoshi Tanaka
 
ApppiumDoc_version2015
Amit DEWAN
 
Midas - on-the-fly schema migration tool for MongoDB.
Dhaval Dalal
 
Docker on Windows - 101 to Production (half-day workshop)
Elton Stoneman
 
"Don’t Run with Scissors: Serverless Security Survival Guide" | Hillel Solow,...
LCloud
 
Php ppt
ankitankesh
 

Similar to Build, Deploy and Run Node Js Application on Azure using Docker (20)

PDF
Build containerized application using Docker and Azure.pdf
Hamida Rebai Trabelsi
 
PDF
Rome .NET Conference 2024 - Remote Conference
Hamida Rebai Trabelsi
 
PDF
Create your first application node.js and windows azure
Steve Xu
 
PPTX
Moving Applications into Azure Kubernetes
Hussein Salman
 
PPTX
Deploying Containers on Azure
Hussein Salman
 
PDF
.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem
NETFest
 
PPTX
Realtime Conf - Lightning node.js dev
Glenn Block
 
PPTX
GlobalAzureBootCamp 2018
girish goudar
 
PPTX
Dockerization of Azure Platform
nirajrules
 
PPTX
Provisioning, deploying and debugging node.js applications on azure
Patriek van Dorp
 
PPTX
Setup docker on existing application
Luc Juggery
 
PPTX
Build Once, Run Anywhere: The Rise of Containerization in Modern IT
Expeed Software
 
PPTX
Codemotion Azure Container Apps
Andrea Tosato
 
PPTX
Kubernetes VS. App Service: When the orchestrator challenges the platform
Lorenzo Barbieri
 
PPTX
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Alex Thissen
 
PDF
Azure-Container-Apps.pdf
Nilesh Gule
 
PPTX
Docker + Node "hello world" Application
Adil Mehmoood
 
PPTX
Using Azure DevOps to continuously build, test, and deploy containerized appl...
Adrian Todorov
 
PDF
Kubernetes vs App Service
Lorenzo Barbieri
 
PDF
Running Containers on Azure
Nick Trogh
 
Build containerized application using Docker and Azure.pdf
Hamida Rebai Trabelsi
 
Rome .NET Conference 2024 - Remote Conference
Hamida Rebai Trabelsi
 
Create your first application node.js and windows azure
Steve Xu
 
Moving Applications into Azure Kubernetes
Hussein Salman
 
Deploying Containers on Azure
Hussein Salman
 
.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem
NETFest
 
Realtime Conf - Lightning node.js dev
Glenn Block
 
GlobalAzureBootCamp 2018
girish goudar
 
Dockerization of Azure Platform
nirajrules
 
Provisioning, deploying and debugging node.js applications on azure
Patriek van Dorp
 
Setup docker on existing application
Luc Juggery
 
Build Once, Run Anywhere: The Rise of Containerization in Modern IT
Expeed Software
 
Codemotion Azure Container Apps
Andrea Tosato
 
Kubernetes VS. App Service: When the orchestrator challenges the platform
Lorenzo Barbieri
 
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Alex Thissen
 
Azure-Container-Apps.pdf
Nilesh Gule
 
Docker + Node "hello world" Application
Adil Mehmoood
 
Using Azure DevOps to continuously build, test, and deploy containerized appl...
Adrian Todorov
 
Kubernetes vs App Service
Lorenzo Barbieri
 
Running Containers on Azure
Nick Trogh
 
Ad

More from Osama Mustafa (20)

PDF
Case study for software architect
Osama Mustafa
 
PPTX
DevOps for database
Osama Mustafa
 
PPTX
Does cloud mean the end of the dba
Osama Mustafa
 
PDF
Using git hub for your code
Osama Mustafa
 
PDF
DevOps Project
Osama Mustafa
 
PDF
Java business service
Osama Mustafa
 
PDF
Steps creating data_integration_services
Osama Mustafa
 
PDF
Oracle api gateway installation as cluster and single node
Osama Mustafa
 
PDF
Helping implementer dealing with famous siebel based system messages and er...
Osama Mustafa
 
PPTX
Weblogic and docker
Osama Mustafa
 
PPTX
Weblogic 101 for dba
Osama Mustafa
 
PDF
Ebs clone r12.2.4
Osama Mustafa
 
PDF
Oracle obia 11.1.1.10.1 installation
Osama Mustafa
 
PDF
Oracle Enterprise manager 13c Installation
Osama Mustafa
 
PDF
Erp installation r12.2
Osama Mustafa
 
PDF
OBIA Installation
Osama Mustafa
 
DOCX
Upgrade EBS DB from 11g to 12c.
Osama Mustafa
 
PPTX
Eouc 12 on 12c osama mustafa
Osama Mustafa
 
PDF
Install oracle siebel on windows 2008 r2
Osama Mustafa
 
PDF
Enable oracle database vault
Osama Mustafa
 
Case study for software architect
Osama Mustafa
 
DevOps for database
Osama Mustafa
 
Does cloud mean the end of the dba
Osama Mustafa
 
Using git hub for your code
Osama Mustafa
 
DevOps Project
Osama Mustafa
 
Java business service
Osama Mustafa
 
Steps creating data_integration_services
Osama Mustafa
 
Oracle api gateway installation as cluster and single node
Osama Mustafa
 
Helping implementer dealing with famous siebel based system messages and er...
Osama Mustafa
 
Weblogic and docker
Osama Mustafa
 
Weblogic 101 for dba
Osama Mustafa
 
Ebs clone r12.2.4
Osama Mustafa
 
Oracle obia 11.1.1.10.1 installation
Osama Mustafa
 
Oracle Enterprise manager 13c Installation
Osama Mustafa
 
Erp installation r12.2
Osama Mustafa
 
OBIA Installation
Osama Mustafa
 
Upgrade EBS DB from 11g to 12c.
Osama Mustafa
 
Eouc 12 on 12c osama mustafa
Osama Mustafa
 
Install oracle siebel on windows 2008 r2
Osama Mustafa
 
Enable oracle database vault
Osama Mustafa
 
Ad

Recently uploaded (20)

DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 

Build, Deploy and Run Node Js Application on Azure using Docker

  • 1. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 1 This documentation explains step by step how to Build, Deploy and Run Node.js application on Azure using docker. The following Source code will be used as test and can be checked from here. Requirements:- • Azure Account (Sign up for a free $200 credit) • Git (Install on the computer) • Docker (Install on the computer) • Node.js (you can use the above link to clone the code). Let’s work !!! Step #1:- After logging to the Azure account, as initial step we must create something called container registry ( ACR will be used later as refer to Azure container Registry) which allows you to store your custom container images privately in the Azure cloud. Access to azure portal from the following link :- https://portal.azure.com/ Figure 1 Create container Registry Then After access the container registry page, press add
  • 2. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 2 Figure 2 add ACR Screen And fill the information depends on the requirement you have. Figure 3 Create ACR And Press create. Wait for couple of second/minute till it will be created, azure will notify you (Notification section) once it’s completed. Step #2:- Once the ACR will be created, press on it, and it will take you to the information about the created ACR, the following information will be needed later.
  • 3. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 3 Figure 4 ACR Login information Step #3:- We need to check the docker login, open Power shell/terminal depends on operating system you are using, to authenticate to ACR and validate the credentials. Figure 5 Test docker Login using ACR information
  • 4. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 4 Figure 6 Test Result, Login Succeeded You should see a message that says, “login succeeded”. As Figure 6. Step #4:- We need to clone the sample code from https://bitbucket.org/network-international/node-js-getting-started/src/master/ Git command should be installed, to do this just press on this link here. Fire the below command on the PowerShell/terminal/command promote. git clone https://github.com/heroku/node-js-getting-started.git Figure 7 Using Git to clone the code After you've cloned the repo, switch into the application directory: You will find files, create file call it Dockerfile (without any extension).
  • 5. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 5 Figure 8 Dockerfile inside cloned repo Inside the file write the following :- Descriptions : - • FROM node:alpine, The FROM command defines the base container image, and the operating system will be Alpine Linux. • WORKDIR /usr/app define the working directory and is where we'll store the application code and if it’s not exists on the OS will be created during the process. • COPY package*.json ./ used during the build process to add the package.json and package-lock.json files to the working directory. • RUN npm install used to execute npm install which will ensure our application dependencies are included within the container image. • COPY . . this is to copy the application source files into the working directory. • CMD ["npm", "start"] defines the default command to execute when the container starts. Step #5:- To do this step, you should be in the same directory as the Dockerfile. Use the docker build command to create your container image, the below command will tell Docker to build your image using the Dockerfile in the current directory. FROM node:alpine WORKDIR /usr/app COPY package*.json ./ RUN npm install COPY . . CMD ["npm", "start"] docker build -t demonetwork.azurecr.io/node-docker-demo:latest .
  • 6. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 6 Figure 9 Build docker image using dockerfile Step #6:- Now we test the login to our docker before, let’s push our image to ACR using the below command, Figure 10 Push the docker Image to ACR docker push demonetwork.azurecr.io/node-docker-demo:latest
  • 7. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 7 Figure 11 Pushing the docker image completed After the command completes successfully, you can head back to the Azure portal to verify that your image is now available in ACR. Figure 12 Verify the command Step #7:- The final step, which is expose the docker application using URL, Azure make this step easy, by creating resource called Web App for containers, to do this just follow the below figures. In the Azure portal, select Create a resource, select Web in the Azure Marketplace, and choose Web App for containers.
  • 8. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 8 Figure 13 Create web app for containers Press on web app for containers Figure 14 Create Web App for containers New page will be open, fill the information, such as the name of instance, will be publish either on Linux or docker container ( our case) , don’t press review + create, press Next: Docker, so you will be able to configure the web app.
  • 9. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 9 Figure 15 Web App Instance details The next screen, which is docker, as you see, I choose “ azure container Registry” and from the drop list, will be appeared our options. Figure 16 web app container configuration Press review creates.
  • 10. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 10 Figure 17 Web App Summary Page Wait for couple of seconds and it will be created. Figure 18 Final Result with URL for the new deployed code As you see if you check the URL and press on it This is the result. https://networktask.azurewebsites.net
  • 11. Build, Deploy and Run Node Js Application on Azure using Docker Osama Mustafa P a g e | 11