DevOps-Showcase

πŸ—£οΈ SpeakX Java REST API Project

🌟 Overview

This project demonstrates a complete end-to-end setup for deploying a 🧩 Spring Boot-based REST API using πŸ‹ Docker, πŸ§‘β€πŸ’» GitHub Actions for CI/CD, and πŸ—οΈ Terraform for Infrastructure as Code (IaC). It follows industry best practices to ensure πŸ”’ security, πŸ“ˆ scalability, and πŸ› οΈ maintainability.


πŸ”§ Project Components

πŸš€ Spring Boot Application

πŸ‹ Docker

βš™οΈ CI/CD Pipeline (GitHub Actions)

πŸ—οΈ Terraform for Infrastructure as Code (IaC)


πŸ“– Step-by-Step Guide

πŸ–₯️ Running the Application Locally

  1. Clone the repository:
    git clone https://github.com/rohan3004/DevOps-Showcase.git
    
  2. Go into speakXDemo Directory:
    cd ./speakXDemo
    
  3. πŸ—οΈ Build the Docker image:
    docker build -t speakx-demo-app .
    
  4. πŸ‹ Run the Docker container:
    docker run -p 8080:8080 speakx-demo-app
    
  5. 🌐 Access the API at http://localhost:8080.

πŸ› οΈ Prerequisite

To ensure a smooth setup, please verify the following prerequisites:

  1. 🐳 Docker Hub Account
    • Ensure you have a 🐳 Docker Hub account.
    • Keep your πŸ§‘β€πŸ’» username and πŸ”’ password ready for authentication.
  2. ☁️ AWS Key-Value Pair
    • You should have already created a πŸ”‘ key-value pair in ☁️ AWS.
    • Provide the πŸ”‘ key-value pair name in the πŸ› οΈ Terraform EC2 module configuration.
  3. πŸ“ Elastic IP and 🌐 Domain Configuration
    • Allocate an πŸ“ Elastic IP in ☁️ AWS.
    • Configure your 🌐 domain to point to the allocated πŸ“ Elastic IP.

βš™οΈ Setting Up CI/CD Pipeline

  1. Add the following πŸ”’ secrets in your GitHub repository app-deploy.yml:
    • DOCKER_USERNAME -> Your docker Username
    • DOCKER_PASSWORD -> Your docker Password
    • EC2_SSH_KEY -> Your ssh key that you created in the prerequisite part.
    • EC2_HOST -> Your Elastic IP provided by AWS or a domain main pointing to that ip
    • EC2_USER -> By Default, ubuntu
  2. Push changes to the speakXDemo directory or trigger the workflow manually from πŸ§‘β€πŸ’» GitHub Actions.
  3. ⚠️ Also make changes to the πŸ› οΈ docker-compose.yml according for the image name and tag in 🐳 docker hub.
  4. ⚠️ Make necessary changes in the πŸ› οΈ app-deploy.yml for the image name and tag.

πŸ—οΈ Provisioning Infrastructure with Terraform

  1. Add the following πŸ”’ secrets in your GitHub repository IaC Pipeline.yml, for best practices create an IAM User for terraform:
    • AWS_ACCESS_KEY_ID -> Get its Access Key
    • AWS_SECRET_ACCESS_KEY-> Get its Secret Access Key
  2. ⚠️ Make necessary changes in the variables.tf present in ec2 module for the domain name and key-value pair name.
  3. Run (to validate everything before triggering the pipeline):
    terraform validate
    
  4. Push changes to the terraform directory or trigger the workflow manually from πŸ§‘β€πŸ’» GitHub Actions.
  5. βœ… Verify that the EC2 instance, 🌐 VPC, and other resources are created successfully in 🌐 AWS.

🌐 Accessing the Application

After deployment, the 🌐 API will be available exclusively via secure πŸ”’ HTTPS, using the 🌐 domain specified during the setup process. For example:


✨ Key Features


🏁 Conclusion

This project provides a comprehensive example of modern πŸ› οΈ DevOps practices, combining πŸ§‘β€πŸ’» application development, πŸ‹ containerization, βš™οΈ CI/CD pipelines, and πŸ—οΈ infrastructure automation. Whether you’re a beginner or an experienced developer, this repository serves as a solid foundation for building and deploying 🌐 cloud-native applications.