Developing a Simple Java Script Application and Creating a Docker Image of the Application Read on Medium Link
I built a simple application using Java script which outputs “My first application deployed successfully “.
Prerequisites
Install the following
-
Docker
-
Docker desktop
-
Git Bash
-
VS Code
Introduction
Docker is a virtualization software which makes development and development of applications easy by packaging an application into a container that has dependencies, it's libraries, configuration, running environment and system tools. That is application and its running environment are packaged into a docker package that can easily be shared. Once you have Docker runtime installed on the server you can simply run Docker command . Docker Desktop an application was created to allow me build, share and run containerized applications and managements. It includes Docker Engine, Docker Client, GUI Client etc. Docker images which are read-only templates containing instructions needed in creating Docker containers were created to let me run the application. I created Docker container, a running instance of an image, an isolated process that packages all the files an application needs, letting my application run consistently on one or more environments .
Building my image, I created an image from a definition written in Dockerfile.
Below is my server.js file
My package.json file
The root of my application
I created a Dockerfile
Built the image by running the command below
I ran the application executing the command below
docker run -d -p 3000:3000 node-app:1.0

Back on the browser is the message from my application .
I opened the browser and typed in localhost:3000 to check if my node-application was successful.
