Skip to main content

Command Palette

Search for a command to run...

Deploying Spring Petclinic Microservices with Docker Compose: My Individual DevOps Deployment Journey🚀

Updated
•3 min read
Deploying Spring Petclinic Microservices with Docker Compose: My Individual DevOps Deployment Journey🚀
G
Turning coffee into code and automation. Aspiring DevOps Engineer sharing projects, tutorials, and tech learnings. 🚀

Introduction

As part of my DevOps Micro Internship journey, I was assigned to individually deploy the Spring Petclinic Microservices application and verify its complete functionality. This project helped me gain hands-on experience with Docker, Microservices, Service Discovery, Monitoring, and Distributed Tracing.

In this blog, I will share my deployment process, challenges, and key learnings.


Project Overview

Spring Petclinic is a cloud-native microservices application built using Spring Boot and Spring Cloud. The application consists of multiple independent services that work together to provide pet management functionality.

Microservices Included

  • Config Server

  • Discovery Server (Eureka)

  • API Gateway

  • Customers Service

  • Vets Service

  • Visits Service

  • Admin Server

  • GenAI Service

  • Monitoring Stack (Prometheus & Grafana)

  • Distributed Tracing (Zipkin)


Technologies Used

  • Java 17

  • Spring Boot

  • Spring Cloud

  • Maven

  • Docker

  • Docker Compose

  • Eureka Service Discovery

  • Prometheus

  • Grafana

  • Zipkin

  • Git & GitHub


Building the Application

The first step was building the entire multi-module project using Maven.

mvn clean install -DskipTests

The build completed successfully and generated all required application artifacts.


Starting the Microservices

To start the entire environment, I used Docker Compose.

docker compose up -d

Docker pulled the required images and started all microservices in the correct startup sequence.

The Config Server and Discovery Server became healthy first, followed by the remaining services.


Service Discovery Verification

After deployment, I verified service registration using the Eureka Dashboard.

Successfully registered services:

  • API Gateway

  • Customers Service

  • Vets Service

  • Visits Service

  • Admin Server

This confirmed that the microservices were communicating correctly through Eureka Service Discovery.


Monitoring with Prometheus

Prometheus was configured to collect metrics from the running microservices.

I verified monitoring by executing:

up

The query showed that application services were actively being scraped and monitored.


Visualization with Grafana

Grafana was connected to Prometheus and provided a centralized monitoring dashboard.

This helped visualize application metrics and monitor service health in real time.


Distributed Tracing with Zipkin

Zipkin was used to trace requests flowing through the microservices architecture.

I successfully captured traces showing requests moving between the API Gateway and backend services, demonstrating end-to-end observability.


Challenges Faced

The most challenging part of the deployment was troubleshooting Docker-related issues.

Some of the challenges included:

  • Docker Desktop daemon not running

  • Image pull failures

  • Container naming conflicts

  • Service startup dependency issues

  • GenAI service configuration problems

Resolving these issues helped me better understand Docker networking, container lifecycle management, and microservices architecture.


Key Learnings

Through this deployment, I learned:

  • How microservices communicate using Eureka Service Discovery

  • Importance of startup dependencies between services

  • Docker Compose orchestration concepts

  • Monitoring using Prometheus and Grafana

  • Distributed tracing using Zipkin

  • Real-world troubleshooting techniques in DevOps environments


Conclusion

Successfully deploying the Spring Petclinic Microservices application independently was a valuable learning experience. It provided practical exposure to containerized applications, monitoring, observability, and DevOps troubleshooting.

This project strengthened my understanding of modern cloud-native application deployment and prepared me for future work involving Kubernetes, AWS, CI/CD, and large-scale microservices environments.

Thank you for reading!

#DevOps #Docker #Microservices #SpringBoot #Java #Prometheus #Grafana #Zipkin #Eureka #CloudComputing #Hashnode #LearningInPublic

4 views