Skip to main content

Posts

Showing posts from August, 2019

Build your own container

Here I will be using the node container as my base image and will build a new container that will host my custom webhook application First create a webhook application using node.js on the host machine Install node.js Initiate a project with npm init npm init  should prompt some project related questions. Install the required dependencies for the project, for our example we need express and body-parser Update index.js to create a webhook  Run the project as node index.js Test that webhook from the browser. We should get a response back. Now lets convert this web application into a docker container and execute the same from docker. To get started, create a file in the same folder where we have created the node project, call it as Dockerfile Update the contents of the file as below: FROM node:latest We are pulling the node image tagged as latest from the docker hub WORKDIR /app Create a working directory called app in the contain