https://github.com/voliveirajr/demorestapi
A Demo Rest API using Spring Boot, MongoDB running in Docker containers
https://github.com/voliveirajr/demorestapi
docker docker-container mongodb spring spring-boot
Last synced: 4 months ago
JSON representation
A Demo Rest API using Spring Boot, MongoDB running in Docker containers
- Host: GitHub
- URL: https://github.com/voliveirajr/demorestapi
- Owner: voliveirajr
- License: gpl-3.0
- Created: 2018-04-28T17:22:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-28T13:46:50.000Z (over 7 years ago)
- Last Synced: 2025-08-25T11:04:00.511Z (10 months ago)
- Topics: docker, docker-container, mongodb, spring, spring-boot
- Language: Java
- Homepage:
- Size: 37.1 KB
- Stars: 9
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.](https://medium.com/@volmar.oliveira.jr/a-restapi-using-spring-boot-mongodb-running-on-docker-containers-5e530b48f45e)
## 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