Skip to main content

Command Palette

Search for a command to run...

Learning Docker: From Containers to Deploying a Node.js Backend

Published
•2 min read•View as Markdown

When learning DevOps, few tools stand out as much as Docker. It’s often described as “just containers,” but diving into it has made me realize it’s much more — it’s a mindset shift in how we build, package, and ship applications.

Understanding the Basics

Before writing a single line of code, I wanted to understand what Docker actually solves. Traditional deployments often run into the “works on my machine” problem. Dependencies differ, environments drift, and suddenly production behaves differently from local.

Docker solves this with containerization:

  • Images act as blueprints, capturing the application and everything it needs.

  • Containers are the running instances of those images.

  • This makes applications portable, reproducible, and consistent across environments.

Building a Simple Node.js Backend

To solidify this, I built a very simple Node.js backend. The code was intentionally minimal — just a small API responding with a message. The point wasn’t to impress with complexity, but to practice containerizing an application end-to-end.

The steps were:

  1. Write a basic index.js in Node.js.

  2. Create a Dockerfile describing how to build the image (using node:22 as a base).

  3. Build the image locally using docker build -t gautamgaurisaria/simple-be-docker .

Pushing to Docker Hub

Once the container ran locally, the next step was sharing it. This is where Docker Hub comes in. By tagging the image with my Docker Hub username and running docker push, the image was published and accessible globally.

Now, anyone can pull and run the same backend exactly as I built it — no setup headaches, no environment mismatches.

Why This Matters

Yes, the project was simple. But the real value wasn’t in the code — it was in the workflow:

  • Writing code → Packaging in Docker → Running anywhere → Publishing to a registry.

  • This is the backbone of modern DevOps.

Recruiters often look not just for finished projects, but for developers who understand the process and can adapt to different environments. Learning Docker, even through a small backend, was about proving to myself (and future employers) that I can adopt this mindset.

Docker Container Link: https://hub.docker.com/repository/docker/gautamgaurisaria/simple-be-docker/general

What’s Next

This was my first step into Docker. The next challenge is integrating containers into CI/CD pipelines and orchestrating them with Kubernetes. But for now, I’m glad to have a working mental model of containerization and a published image to show for it.

Learning in public keeps me accountable — and it makes the journey more rewarding.

More from this blog

First-Principles Notes

16 posts

First-Principles Notes is a public log of thinking in the open. I break systems down to fundamentals, question assumptions, get things wrong, update my models, and write to learn rather than perform.