Skip to main content

Posts

Showing posts from July, 2019

How to dockerize a spring boot application

Greetings! Spring boot helps us to create application very quickly. Docker provides us a way to "build, ship and run" our applications. In a world of Microservices, combining these two gives us powerful ways to create and distribute our Java applications. I assume you have enough Spring boot and Docker knowledge and want study further to dockerize Spring boot applications. https://github.com/slmanju/springtime/tree/master/spring-boot-docker Let's create a simple rest service and dockerize it. Step 1: Create Spring boot application Go to https://start.spring.io and fill it as you want. Then add Spring Web Starter as a dependency. This is enough for us create a simple rest service. Download and extract the application. Then add below controller (or anything you like). package com.slmanju.springbootdocker; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HomeC