Today was a massive step forward in my DevOps journey. I moved away from simply running containers individually and tackled Dockerizing a full 3-tier MERN application (MongoDB, Express/Node, React).
Here is a breakdown of what I built, the bugs I squashed, and the enterprise tools I explored.
ποΈ The Project: 3-Tier Architecture
Instead of running npm start in three different terminals, I wanted to containerize the entire stack.
Frontend: React (running in a container).
Backend: Node.js/Express (API layer).
Database: MongoDB (persistent storage).
π Orchestration with Docker Compose
The real game-changer today was using Docker Compose. Writing a docker-compose.yml allowed me to define the lifecycle of all three containers in a single file.
I defined services for the client, server, and database, set up the networking so they could talk to each other (using service names as hostnames is magic!), and defined volumes for data persistence. Now, bringing up the whole environment is just: docker-compose up --build
π The "Gotcha" Moment
It wouldnβt be a coding day without an error. I ran into an issue where Everything worked perfectly on my local setup. But the moment I spun up the container, it crashed with a binary compatibility error.
It turned out that my COPY . . command was copying my local Windows-based node_modules into the Linux container. Since esbuild and other binaries are OS-specific, the Linux container couldn't run the Windows binaries.
How I resolved it: I realized that The Solution: I learned that the clean build happening inside the container (via RUN npm install) was being overwritten by my local files.
To fix this, I:
Created a .dockerignore file to explicitly exclude node_modules and .gitignore.
Deleted the corrupted image.
Rebuilt the image using the --no-cache flag to ensure a completely fresh installation. Once I updated the configuration, the containers communicated perfectly.
π’ Beyond Code: ITSM Tools
While waiting for builds, I stepped back to learn about the "Process" side of DevOps. I looked into:
Jira & Confluence: For tracking tasks and documentation.
ServiceNow: Specifically regarding Incident Management (handling outages) and Change Management (safely deploying updates). Understanding how these tools fit into the CI/CD pipeline is crucial for working in enterprise environments.
π What's Next?
I have conquered Docker Compose. The natural next step? Orchestration at scale. Starting tomorrow, I am diving into Kubernetes (K8s). Can't wait to see how pods and services compare to what I did today.
Linkedin: https://www.linkedin.com/in/dasari-jayanth-b32ab9367/
Top comments (0)