This week, I focused on learning Docker fundamentals as part of my DevOps learning journey.
Instead of only memorizing commands or following tutorials blindly, I wanted to understand how Docker is actually used in real projects. So I decided to build something small, practical, and close to real-world architecture.
Why Docker?
- Before Docker, running an application meant:
- Installing dependencies manually
- Dealing with environment mismatches
- Hearing the classic “it works on my machine” problem
Docker solves this by packaging applications and their dependencies into containers, making them portable, consistent, and repeatable.
What I Built
To apply what I learned, I built a three-tier MERN stack application using Docker.
The application is structured as:
- Frontend: React-style frontend served via Nginx
- Backend: Node.js + Express API
- Database: MongoDB
Each component runs in its own Docker container, and all services communicate through a shared Docker network.
The entire application can be started using a single command:
- docker compose up --build
Docker Concepts I Practiced
While building this project, I worked with the following Docker concepts:
1. Docker Images & Containers
I learned how images are built from Dockerfiles and how containers are created from those images.
2. Dockerfiles
I wrote Dockerfiles for both frontend and backend services to define how each application should be built and run.
3. Multi-Stage Docker Builds
To optimize image size, I used multi-stage builds so that build-time dependencies don’t end up in the final production image.
This helped me understand how production-ready Docker images are created.
4. Docker Networking
All services run on a custom Docker network, allowing containers to communicate with each other using service names instead of IP addresses.
5. Docker Volumes
MongoDB uses a Docker volume to persist data, ensuring the database data is not lost when containers restart.
6. Docker Compose
Docker Compose ties everything together by defining all services, networks, and volumes in a single file.
What I Learned
Some key takeaways from this project:
- Docker becomes much clearer when you build something end-to-end
- Multi-container applications are easier to manage with Docker Compose
- Volumes are critical for data that should survive container restarts
- Docker is less about commands and more about reproducible environments
Why This Project Matters
This project is not meant to be production-scale or overly complex.
Its purpose is to serve as a proof of work — showing that I understand Docker fundamentals by applying them in a realistic setup.
Repository
GitHub Repository:https://github.com/snehatomar1205/DevOps
Top comments (0)