<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Benjamin Akinteye</title>
    <description>The latest articles on DEV Community by Benjamin Akinteye (@benjamin_akinteye_159fb76).</description>
    <link>https://dev.to/benjamin_akinteye_159fb76</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3983559%2F38145dd9-32e4-4575-9ccb-9e9cd2aeb766.jpeg</url>
      <title>DEV Community: Benjamin Akinteye</title>
      <link>https://dev.to/benjamin_akinteye_159fb76</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/benjamin_akinteye_159fb76"/>
    <language>en</language>
    <item>
      <title>Deploying Spring PetClinic Microservices Locally with Docker: My Experience</title>
      <dc:creator>Benjamin Akinteye</dc:creator>
      <pubDate>Sun, 14 Jun 2026 08:54:56 +0000</pubDate>
      <link>https://dev.to/benjamin_akinteye_159fb76/deploying-spring-petclinic-microservices-locally-with-docker-my-experience-2dih</link>
      <guid>https://dev.to/benjamin_akinteye_159fb76/deploying-spring-petclinic-microservices-locally-with-docker-my-experience-2dih</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;As part of my DevOps learning journey with DMI, I deployed the Spring PetClinic Microservices application locally using Docker Desktop.&lt;/p&gt;

&lt;p&gt;Spring PetClinic is a sample microservices application widely used for learning cloud-native development and DevOps practices. Instead of running as a single application, it consists of several independent services that work together, including configuration management, service discovery, API routing, monitoring, and distributed tracing.&lt;/p&gt;

&lt;p&gt;The objective of this exercise was to deploy the entire application stack on my local machine, understand how the services interact, and gain hands-on experience troubleshooting a real microservices environment.&lt;/p&gt;

&lt;p&gt;Prerequisites&lt;/p&gt;

&lt;p&gt;Before starting the deployment, I installed the following tools:&lt;/p&gt;

&lt;p&gt;Docker Desktop&lt;br&gt;
Git&lt;br&gt;
Java 17&lt;br&gt;
Maven (for local development if needed)&lt;br&gt;
Visual Studio Code&lt;/p&gt;

&lt;p&gt;I also verified that Docker Desktop was running correctly before attempting the deployment.&lt;/p&gt;

&lt;p&gt;Cloning the Repository&lt;/p&gt;

&lt;p&gt;The first step was cloning the project repository.&lt;/p&gt;

&lt;p&gt;git clone &lt;br&gt;
cd spring-petclinic-microservices&lt;/p&gt;

&lt;p&gt;Once inside the project directory, I reviewed the project structure and confirmed that the Docker Compose file was available.&lt;/p&gt;

&lt;p&gt;dir&lt;/p&gt;

&lt;p&gt;I located the docker-compose.yml file, which contained the definitions for all application services.&lt;/p&gt;

&lt;p&gt;Building the Custom Images&lt;/p&gt;

&lt;p&gt;The project included custom configurations for Prometheus and Grafana, so I built the images before starting the application.&lt;/p&gt;

&lt;p&gt;docker compose build&lt;/p&gt;

&lt;p&gt;The build process downloaded dependencies and created the required Docker images.&lt;/p&gt;

&lt;p&gt;After the build completed successfully, I verified the images:&lt;/p&gt;

&lt;p&gt;docker images&lt;br&gt;
Starting the Application&lt;/p&gt;

&lt;p&gt;To deploy the entire stack, I ran:&lt;/p&gt;

&lt;p&gt;docker compose up -d&lt;/p&gt;

&lt;p&gt;This command created the network and containers defined in the Compose file.&lt;/p&gt;

&lt;p&gt;At first, everything appeared normal.&lt;/p&gt;

&lt;p&gt;docker ps -a&lt;/p&gt;

&lt;p&gt;However, I noticed that many containers remained in the Created state rather than transitioning to Running.&lt;/p&gt;

&lt;p&gt;That was the first indication that something was wrong.&lt;/p&gt;

&lt;p&gt;Troubleshooting the Startup Process&lt;/p&gt;

&lt;p&gt;The most challenging part of the deployment was understanding why the services were not starting.&lt;/p&gt;

&lt;p&gt;I began investigating with:&lt;/p&gt;

&lt;p&gt;docker compose ps&lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;docker logs config-server&lt;/p&gt;

&lt;p&gt;The issue turned out to be related to service dependencies and health checks.&lt;/p&gt;

&lt;p&gt;The application uses a startup sequence where certain services must become healthy before others can start.&lt;/p&gt;

&lt;p&gt;Why Config Server Starts First&lt;/p&gt;

&lt;p&gt;The Config Server acts as a central configuration repository for all microservices.&lt;/p&gt;

&lt;p&gt;When a service starts, it first retrieves its configuration from the Config Server.&lt;/p&gt;

&lt;p&gt;Without it, the remaining services do not know how they should be configured.&lt;/p&gt;

&lt;p&gt;The Docker Compose file enforces this dependency through health checks and startup conditions.&lt;/p&gt;

&lt;p&gt;During troubleshooting, I confirmed the health status using:&lt;/p&gt;

&lt;p&gt;docker inspect config-server --format='{{json .State.Health}}'&lt;/p&gt;

&lt;p&gt;Eventually, the Config Server reported:&lt;/p&gt;

&lt;p&gt;Status: healthy&lt;/p&gt;

&lt;p&gt;which allowed the next stage of the startup process to continue.&lt;/p&gt;

&lt;p&gt;Why Discovery Server Starts Second&lt;/p&gt;

&lt;p&gt;After the Config Server becomes available, the Discovery Server (Eureka) starts.&lt;/p&gt;

&lt;p&gt;The Discovery Server allows services to register themselves and discover other services on the network.&lt;/p&gt;

&lt;p&gt;Services such as:&lt;/p&gt;

&lt;p&gt;Customers Service&lt;br&gt;
Visits Service&lt;br&gt;
Vets Service&lt;br&gt;
API Gateway&lt;br&gt;
Admin Server&lt;/p&gt;

&lt;p&gt;all depend on Eureka to locate one another.&lt;/p&gt;

&lt;p&gt;Without Discovery Server, service-to-service communication cannot function properly.&lt;/p&gt;

&lt;p&gt;One interesting observation was that the Discovery Server took much longer to start than expected.&lt;/p&gt;

&lt;p&gt;Its logs showed that initialization required over a minute before the health checks passed.&lt;/p&gt;

&lt;p&gt;I verified its status using:&lt;/p&gt;

&lt;p&gt;docker logs discovery-server&lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;docker inspect discovery-server --format='{{json .State.Health}}'&lt;/p&gt;

&lt;p&gt;Once both Config Server and Discovery Server became healthy, the rest of the services were able to start.&lt;/p&gt;

&lt;p&gt;Verifying the Deployment&lt;/p&gt;

&lt;p&gt;After the startup sequence completed, I verified the deployment by accessing the exposed endpoints.&lt;/p&gt;

&lt;p&gt;Config Server&lt;br&gt;
&lt;a href="http://localhost:8888" rel="noopener noreferrer"&gt;http://localhost:8888&lt;/a&gt;&lt;br&gt;
Eureka Dashboard&lt;br&gt;
&lt;a href="http://localhost:8761" rel="noopener noreferrer"&gt;http://localhost:8761&lt;/a&gt;&lt;br&gt;
API Gateway&lt;br&gt;
&lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Eureka dashboard was particularly useful because it showed registered services and confirmed that service discovery was working correctly.&lt;/p&gt;

&lt;p&gt;Exploring the Observability Stack&lt;/p&gt;

&lt;p&gt;One of the most interesting parts of the deployment was exploring the monitoring and tracing tools included with the project.&lt;/p&gt;

&lt;p&gt;Prometheus&lt;/p&gt;

&lt;p&gt;Prometheus was responsible for collecting application metrics.&lt;/p&gt;

&lt;p&gt;I accessed it through:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:9091" rel="noopener noreferrer"&gt;http://localhost:9091&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Prometheus provided visibility into application performance and service metrics.&lt;/p&gt;

&lt;p&gt;Grafana&lt;/p&gt;

&lt;p&gt;Grafana was available at:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:3030" rel="noopener noreferrer"&gt;http://localhost:3030&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using Grafana dashboards, I could visualize the metrics collected by Prometheus and observe how the services behaved during runtime.&lt;/p&gt;

&lt;p&gt;Zipkin&lt;/p&gt;

&lt;p&gt;Zipkin was available at:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:9411" rel="noopener noreferrer"&gt;http://localhost:9411&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was probably my favorite part of the deployment.&lt;/p&gt;

&lt;p&gt;After generating traffic through the application, I could see traces showing requests moving between services.&lt;/p&gt;

&lt;p&gt;Instead of simply seeing whether a service was running, Zipkin showed how requests flowed through the microservices architecture and how long each step took.&lt;/p&gt;

&lt;p&gt;It provided a practical demonstration of distributed tracing and helped me better understand how modern microservices are monitored in production environments.&lt;/p&gt;

&lt;p&gt;Key Lessons Learned&lt;/p&gt;

&lt;p&gt;The biggest lesson from this deployment was that creating containers successfully does not necessarily mean the application is running correctly.&lt;/p&gt;

&lt;p&gt;Most of the time spent on the deployment involved understanding service dependencies, reviewing logs, and checking health status.&lt;/p&gt;

&lt;p&gt;I also learned the importance of:&lt;/p&gt;

&lt;p&gt;Docker health checks&lt;br&gt;
Service startup order&lt;br&gt;
Troubleshooting with container logs&lt;br&gt;
Understanding microservice dependencies&lt;br&gt;
Monitoring and observability tools&lt;/p&gt;

&lt;p&gt;Working through these issues gave me a much deeper understanding of how containerized applications operate compared to simply reading about them.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Deploying the Spring PetClinic Microservices application locally provided valuable hands-on experience with Docker, microservices, service discovery, monitoring, and troubleshooting.&lt;/p&gt;

&lt;p&gt;While the deployment was not completely smooth, the challenges were actually the most valuable part of the exercise. Investigating why services failed to start and understanding how the application components depended on one another helped reinforce key DevOps concepts in a practical way.&lt;/p&gt;

&lt;p&gt;This project was completed as part of my learning journey with DMI.&lt;/p&gt;

&lt;p&gt;DMI Cohort 3 Registration:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.google.com/forms/d/e/1FAIpQLSel7ai7nyb0P1qLW4vEyfB_nEsD4lUF1XG88vmAaFGBOb6hPA/viewform" rel="noopener noreferrer"&gt;https://docs.google.com/forms/d/e/1FAIpQLSel7ai7nyb0P1qLW4vEyfB_nEsD4lUF1XG88vmAaFGBOb6hPA/viewform&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>microservices</category>
      <category>dmi</category>
    </item>
  </channel>
</rss>
