Dockerizing a Node App

In this article I will be covering a basic understanding of how a Node.js application is structured assuming you have a working Docker installation. Please take the necessary steps to download Docker if you have not already.

Step 1: Initiate a new Node.Js App with NPM init

Step 2: Run npm -i (AKA: npm install)

Step 3: Create Index.js file

Step 4: Create your Dockerfile: touch Dockerfile

Step 5: Touch docker-compose.yml

Step 6: Touch .dockerignore

Step 7: Build Your Docker Container

docker build -t [App-name] .

Step 8: Run Docker Container

docker run -it -p 3000:3000 [App-name]




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store