MODULE 12 - Deployment and Production
Welcome to Module 12! πβ
Your application works in development... but how do you put it into production? This module covers the entire deployment cycle: packaging, Docker, CI/CD, and cloud.
π Learning Objectivesβ
By the end of this module, you will be able to:
- β Prepare an application for production
- β Create optimized Docker images
- β Set up a CI/CD pipeline
- β Deploy to the cloud (Heroku, Railway, AWS)
- β Manage configurations by environment
π Prerequisitesβ
Before starting this module, you should have:
- β Completed Modules 1 to 11
- β Docker Desktop installed
- β A GitHub account
- β Basics of Git (commit, push, branches)
πΊοΈ Module Outlineβ
Theoretical Part (4 chapters)β
Chapter 1: Preparation for Productionβ
Duration: 45 minutes
Content:
- Executable JAR vs WAR
- Spring profiles (dev, prod, test)
- Externalized configuration
- Environment variables
- Secrets security
Why important? Properly prepare the application
Chapter 2: Docker Containerizationβ
Duration: 1 hour
Content:
- Dockerfile for Spring Boot
- Multi-stage builds
- Docker Compose
- Optimizations (layers, JVM)
- Lightweight images
Why important? Industry standard
Chapter 3: CI/CD with GitHub Actionsβ
Duration: 1 hour
Content:
- Introduction to CI/CD
- GitHub Actions workflows
- Automated build and tests
- Docker image publishing
- Automatic deployment
Why important? Automate deployments
Chapter 4: Cloud Deploymentβ
Duration: 45 minutes
Content:
- Heroku / Railway
- AWS (Elastic Beanstalk, ECS)
- Kubernetes basics
- Managed databases
- Production monitoring
Why important? Go live
Practical Part (2 Labs)β
Lab 12.1: Complete Dockerizationβ
Duration: 1h30
Objective: Containerize the application
You will:
- Create an optimized Dockerfile
- Build a multi-stage image
- Configure Docker Compose (app + DB)
- Test locally
Lab 12.2: CI/CD Pipelineβ
Duration: 1h30
Objective: Automate deployment
You will:
- Create a GitHub Actions workflow
- Automate tests and build
- Publish on Docker Hub
- Deploy on Railway/Heroku
π Total Durationβ
| Type | Duration |
|---|---|
| Theory | 3h30 (4 chapters) |
| Practice | 3h (2 Labs) |
| Total | 6h30 (~2 sessions) |
π― What You Will Understandβ
Before this Moduleβ
# Local development only π°
mvn spring-boot:run
# "How do I put this online?"
# "What is Docker?"
# "CI/CD?"
After this Moduleβ
# Automatic build on each push
git push origin main
# β GitHub Actions:
# β
Tests passed
# β
Docker image built
# β
Published on Docker Hub
# β
Deployed to production
# Your app accessible at:
# https://my-app.railway.app
# Optimized Dockerfile
FROM eclipse-temurin:17-jre-alpine
COPY target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]
π Why This Module Is Essentialβ
1. Essential Skillβ
Job offers 2024:
β "Docker" - 90% of offers
β "CI/CD" - 85% of offers
β "Cloud (AWS/GCP/Azure)" - 80% of offers
β "Kubernetes" - 60% of offers
2. DevOps Cultureβ
Before:
Dev: "It works on my machine"
Ops: "It doesn't work in prod"
Now (DevOps):
- Same environment everywhere (Docker)
- Automatic deployment (CI/CD)
- Infrastructure as Code
3. Velocityβ
Without CI/CD:
- Manual deployment: 2 hours
- Risk of human error
- Stress on Friday
With CI/CD:
- Automatic deployment: 5 minutes
- Reproducible
- Deploy whenever you want
πΊοΈ Progression in the Trainingβ
Module 12 = Your application accessible to the world!
π How to Approach This Moduleβ
Recommended Progressionβ
- Chapter 1 β Understand packaging
- Chapter 2 + Lab 12.1 β Master Docker
- Chapter 3 + Lab 12.2 β CI/CD Pipeline
- Chapter 4 β Deployment options
Technical Prerequisitesβ
# Make sure you have:
docker --version # Docker Desktop
git --version # Git
java -version # Java 17+
mvn -version # Maven
β Self-Assessmentβ
Before starting, answer:
- Do you have Docker installed? β Yes β No
- Do you have a GitHub account? β Yes β No
- Do you know what a Dockerfile is? β Yes β No
- Are you familiar with CI/CD? β Yes β No
- Have you ever deployed an app? β Yes β No
This module will make you proficient in all of this!
π― Next Stepβ
Ready to deploy to production?
β‘οΈ Start with Chapter 1: Production Preparation