Skip to main content

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:

  1. βœ… Prepare an application for production
  2. βœ… Create optimized Docker images
  3. βœ… Set up a CI/CD pipeline
  4. βœ… Deploy to the cloud (Heroku, Railway, AWS)
  5. βœ… 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​

TypeDuration
Theory3h30 (4 chapters)
Practice3h (2 Labs)
Total6h30 (~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​

  1. Chapter 1 β†’ Understand packaging
  2. Chapter 2 + Lab 12.1 β†’ Master Docker
  3. Chapter 3 + Lab 12.2 β†’ CI/CD Pipeline
  4. 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:

  1. Do you have Docker installed? ☐ Yes ☐ No
  2. Do you have a GitHub account? ☐ Yes ☐ No
  3. Do you know what a Dockerfile is? ☐ Yes ☐ No
  4. Are you familiar with CI/CD? ☐ Yes ☐ No
  5. 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


⬅️ Back to Course Outline