Week 8 - Docker and Deployment
๐ Overview
Welcome to Week 8 of the Learn Java for Beginners mentorship program.
In the previous weeks, you learned:
- Core Java programming
- Collections and exception handling
- File IO and multithreading
- Design patterns
- Spring Boot development
- JPA and Hibernate
- Testing and validation
Now it is time to learn how real backend applications are packaged, deployed, and executed in modern environments using Docker.
This week introduces containerization concepts and deployment fundamentals that are essential for modern backend developers and cloud-native engineers.
๐ฏ Learning Objectives
By the end of this week, you should be able to:
- Understand what Docker is and why it is used
- Understand containerization fundamentals
- Create Docker images for Java applications
- Write and understand Dockerfiles
- Build and run Docker containers
- Use Docker Compose for multi-container applications
- Containerize a Spring Boot application
- Run a backend application with a database using Docker Compose
- Understand basic deployment concepts
๐ Topics Covered
1. Introduction to Docker
- What is Docker
- Containers vs Virtual Machines
- Why containers are important
- Advantages of containerization
2. Docker Fundamentals
- Docker Engine
- Docker Images
- Docker Containers
- Docker Registry
- Docker Hub
3. Essential Docker Commands
docker builddocker rundocker psdocker imagesdocker logsdocker execdocker stopdocker rm
4. Writing Dockerfiles
- Dockerfile structure
- Base images
- COPY instruction
- WORKDIR
- EXPOSE
- ENTRYPOINT
- CMD
5. Containerizing Spring Boot Applications
- Building executable JAR files
- Creating Docker images for Spring Boot
- Running Spring Boot containers
6. Docker Compose
- Multi-container applications
- Connecting application and database
- docker-compose.yml basics
7. Basic Deployment Concepts
- Local deployment
- Environment variables
- Port mapping
- Persistent storage basics
- Introduction to cloud-native deployment concepts
๐ Practical Activities
During this week, you will:
- Install Docker
- Build your first Docker image
- Run Java applications inside containers
- Create Dockerfiles
- Containerize your Spring Boot application
- Run MySQL/PostgreSQL using Docker
- Connect Spring Boot with database containers
- Use Docker Compose to manage services
๐งช Testing Focus
As part of this week, you should verify:
- Whether containers start correctly
- Whether application logs are visible
- Whether APIs are reachable
- Whether database connections work properly
- Whether port mappings are configured correctly
You should also practice debugging failed containers using logs and Docker commands.
๐ Files in This Week
| File | Purpose |
|---|---|
| study-material.md | Detailed learning material |
| exercises.md | Practice exercises |
| assignment.md | Weekly implementation assignment |
| quiz.md | Conceptual and practical quiz |
| assessment.md | Weekly assessment criteria |
| review-checklist.md | Weekly mentor review checklist |
| solutions.md | Reference solutions and explanations |
โฑ Recommended Schedule
| Activity | Suggested Time |
|---|---|
| Study Material | 3-4 Hours |
| Hands-on Practice | 4-5 Hours |
| Exercises | 2 Hours |
| Assignment | 3-4 Hours |
| Review Preparation | 1 Hour |
๐ง Mentorship Guidance
This week is extremely important because it bridges the gap between:
- Writing code and
- Running applications in real environments
Modern backend engineers are expected not only to write APIs but also to understand how applications are packaged, deployed, and executed reliably.
Take your time to understand the workflow practically by running commands and debugging issues yourself.
โ Expected Outcome
By the end of Week 8, you should be capable of:
- Packaging backend applications using Docker
- Running containerized Spring Boot applications
- Managing application dependencies using Docker Compose
- Understanding basic deployment workflows
- Troubleshooting container-related issues
๐ Next Steps After This Week
After completing this week, you can continue learning:
- Kubernetes
- OpenShift
- CI/CD Pipelines
- Helm Charts
- Cloud Deployments
- Container Security
- Observability and Monitoring
๐ License
This project is licensed under the GNU GPL-3.0 License.
Maintained by Aditya Pratap Bhuyan LinkedIn: https://linkedin.com/in/adityabhuyan