/DemoRestAPI

A Demo Rest API using Spring Boot, MongoDB running in Docker containers

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Demo Rest API

This is a Demo rest API using Spring Boot, MongoDB running in docker containers defined by docker-compose yml file.

A full article is available on this medium post.

Requirements

  • Java 8
  • Maven 3.3.9
  • Docker 1.13.1
  • Docker-compose 1.21.0

TL;DR - Build and Run

Will build, package and create a new Docker image with the application

mvn clean package

Launch an Application and a Mongo container

docker-compose up

Docker

The docker file defines a container based on Java with the jar created by maven package, the dockerfile-maven-plugin is responsible to build a new image, a push could be configured in the pom file also.

Docker-compose

The Docker-compose file describes our multi-container application, the application consists in 2 containers, one running the DemoRestApi and a linked container with MongoDB. These containers have the 8080 port exposed for the RestAPI and 27017 for mongo (Just for testing purposes, should preferably removed)

Next Steps

  • Tests improvements
  • Authentication

This is just a initial implementation to be used as example exercising Spring boot, Docker, MongoDB. Another features and technologies will be added to this project.

Author

Volmar Oliveira Junior

volmar.oliveira.jr@gmail.com