Development notes

Thoughts, notes and ideas about development

How to run Spring Boot and MongoDB in Docker using Docker Compose

Into the previous post How to run Spring Boot and MongoDB in Docker container I described how to start Spring Boot web application and MongoDB in docker using Dockerfiles. Described approach works, but has some drawbacks: we need to remember all commands and repeat them from time to time. Into this tutorial I’ll describe how to build locally a Docker image with Java application and run it together with MongoDB in Docker containers using Docker Compose. Continue reading

How to run Spring Boot and MongoDB in Docker container

Introduction This tutorial describes how to run Spring Boot application and Mongo DB in Docker containers. For demo purpuses we’ll use the following project: spring-mongo-demo. All sources can be found on Github. Our goal is to run our Spring Boot application and MongoDB in its own containers. Some words about Demo project Demo project (spring-boot-demo) is very simple and does the following: it saves the users into Mongo DB. A new added user is displayed in the Users table on the bottom of the page: Requirements We need: Continue reading