πŸš€ Node.js Demo App – My Journey to Automated Deployment with GitHub Actions & Docker

This month, I challenged myself to take a simple Node.js application and deploy it the way a real DevOps pipeline would β€” fully automated from code commit to deployment.
No manual builds, no β€œdocker run” copy-paste, and no pushing images by hand.

That’s how Node.js Demo App was born β€” a small project that taught me how powerful GitHub Actions can be when paired with Docker.


πŸ“‚ Project Overview

The application itself is straightforward β€” a Node.js web app that serves content on port 3000. But the real focus here wasn’t the app’s complexity, it was the automation pipeline behind it.

Repository: nodejs-demo-app

Structure:

.
β”œβ”€β”€ app.js              # Main app logic
β”œβ”€β”€ Dockerfile          # Container build instructions
β”œβ”€β”€ package.json        # Node.js dependencies
└── .github/
    └── workflows/
        └── main.yml    # GitHub Actions workflow

πŸ› οΈ Tools & Technologies

  • Node.js – For the web app itself

  • Docker – To package and ship the app in containers

  • DockerHub – To store and share the container image

  • GitHub Actions – To automate the build, test, and push process


βš™οΈ The CI/CD Workflow

The pipeline lives in πŸ“„ .github/workflows/main.yml and runs every time I push to main.

Here’s what happens behind the scenes:

  1. Checkout Code – GitHub Actions pulls the latest code from the repository.

  2. Setup Node.js – The runner gets a Node.js environment ready.

  3. Install Dependencies – Runs npm install to set up required packages.

  4. Run Tests – Validates the app to make sure nothing’s broken before deployment.

  5. Authenticate with DockerHub – Uses my GitHub Secrets to log in securely.

  6. Build Docker Image – Creates a production-ready container image.

  7. Push to DockerHub – Publishes the image so it’s instantly available anywhere.


πŸ” Secure Credentials

To make this work without exposing my password, I stored these secrets in GitHub:

Secret NamePurpose
DOCKER_USERNAMEDockerHub username
DOCKER_PASSWORDDockerHub password or access token

🐳 Running the App Locally

If you want to run it locally without CI/CD, it’s just:

npm install
npm start

The app runs on http://localhost:3000.

Or, if you want to use my Docker image:

docker pull <dockerhub-username>/<image-name>
docker run -p 3000:3000 <dockerhub-username>/<image-name>

πŸ“¦ The Result

The beauty of this setup is that I no longer have to worry about manual builds or deployments. Every time I push code to main, a new Docker image is automatically built, tested, and pushed to DockerHub.

This is the kind of automation that DevOps is all about β€” repeatable, reliable, and fast.


πŸ™‹β€β™‚οΈ About Me

I’m Harshal Vernekar, an aspiring DevOps & Cloud Engineer passionate about automation, CI/CD, and cloud-native technologies.

0
Subscribe to my newsletter

Read articles from HARSHAL VERNEKAR directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

HARSHAL VERNEKAR
HARSHAL VERNEKAR

πŸš€ Aspiring DevOps & Cloud Engineer with a strong foundation in cloud platforms (AWS), infrastructure automation, and container orchestration tools like Docker and Kubernetes. I’m passionate about building reliable, scalable, and secure cloud-native applications. πŸ”§ Currently building real-world projects using Terraform, Ansible, Jenkins, GitHub Actions, and EKS to understand how modern infrastructure is deployed, managed, and monitored. I enjoy breaking things (safely), debugging, and learning from hands-on experience. πŸ“¦ Comfortable working with: AWS (EC2, S3, IAM, VPC, EKS) Docker, Kubernetes (Minikube & EKS) CI/CD tools like Jenkins & GitHub Actions IaC tools like Terraform & Ansible Monitoring with Prometheus & Grafana Linux, Bash, Git, and Networking fundamentals πŸ’‘ Always learning β€” currently exploring deeper concepts in Kubernetes workloads, Helm, and scaling best practices. πŸ” Open to DevOps, Cloud, or SRE roles where I can grow, contribute, and solve real-world problems.