You have a self contained web app that runs in a docker container and want to deploy it on a cloud service. I will show you how easy it is to deploy your docker image to Azure App Services. I will, as an example use a simple Node.js Express web app in this demonstration.
- Node.js and NPM are installed on your computer
- Docker Desktop is installed on your computer
- You have an Azure subscription
- Git is installed on your computer
- You have a docker hub account
npm installnpm start
Server running on port 3000Connected to the SQLite database.
You can view a pie-chart summarizing the above information at http://localhost:3000/chart.html as shown below:
This data is being dynamically read from a SQLite database file named school.db located in the root of the web app.
Building our docker image
FROM node:12.18.1WORKDIR /appCOPY ["package.json", "package-lock.json*", "./"]RUN npm installCOPY . .EXPOSE 3000CMD [ "npm", "start" ]
Deploying solution to Azure App Services
Options: Single ContainerImage Source: Docker HubAccess Type: PublicImage and tag: enter the fully qualified name of your docker imageStartup Command: leave blank