Sophia Parafina

Developing a Spring Boot app on Docker: The AtSea Demo App

This is the first of a series of blog posts that demonstrates using Docker to develop a typical web application and deploying it in production. For DockerCon 2017, we wanted to build a new demo application that would demonstrate the flexibility of using Docker in development as well as showcase the features of Docker in a production environment. The result was the AtSea Shop, a storefront application that can be deployed on different operating systems and can be customized to both your enterprise development and operational environment.

A Hybrid Architecture

The team decided on a few ground rules. First, we wanted to use modern components commonly used in enterprise applications. We decided to build a Java application using the Spring Boot framework. The web client is a javascript application written using React as a framework.  Second, the application should be able to use any relational database and that it could be deployed on a Linux or Windows environment or cluster. Finally, the team wanted to show the process from development to deployment including building the application, implementing security, and deploying the application.

Docker Demo App

The application combines a typical Java n-tier architecture that uses Spring Boot’s web MVC framework for the REST API and Spring Data to manage database operations. We chose PostgreSQL for the database, but the application can use any database defined by Spring Data. The storefront client was developed separately using React, and added to the AtSea jar file. Finally, we used a bash script to simulate a payment gateway that uses secrets to authorize transactions.

Although the application is deployed in an n-tier configuration, with the javascript client included in the application jar, each of these components could be deployed separately in a microservice architecture.

Developing and Deploying with Docker

Developing an application with a distributed team can be challenging. Docker provides significant advantages when developing an application by:

  • enabling migration to microservices
  • establishing a consistent deployment environment
  • developers can use familiar tools and IDEs
  • allowing for rapid implementation and testing of ideas
  • simplifying the process to deploying to production
  • easily develop polyglot applications with multiple programming languages
  • building in security tools
  • enabling quick deployment of your application

You can see the code for the AtSea app in our new Docker Samples organization on GitHub, where we share our sample applications.

In following articles, we’ll go into depth on the following topics

  • developing with Eclipse and Docker
  • using multistage builds to create containers
  • implementing container security using secrets
  • deploying the application to a cluster
  • running the application in Windows containers

While you’re waiting, check out these developer resources and videos from Dockercon 2017.

, , , ,

Sophia Parafina

Developing a Spring Boot app on Docker: The AtSea Demo App


One Response to “Developing a Spring Boot app on Docker: The AtSea Demo App”

  1. Martin Farrell

    Looking forward to seeing your approach to using docker and spring boot for development. Its something I want to introduce on my current project

    Reply

Leave a Reply to Martin Farrell

Click here to cancel reply.

Get the Latest Docker News by Email

Docker Weekly is a newsletter with the latest content on Docker and the agenda for the upcoming weeks.