Skip to content

tuanvayn/demo-spring-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo simple "microservice"

Simple Spring boot service run as microservice.

Description

This simple project just show simple CRUD services with little config to show up how service works.

Getting Started

Prerequisites

  • Windows OS or Linux distros
  • Docker
  • Docker compose
  • Java 11
  • Maven

Installing

Run in dev environment

  • Start the database up

    docker-compose up -d db
  • Start services

    mvn clean install -DskipTests
    java -jar target/demo-0.0.1-SNAPSHOT.jar -Dspring.profiles.active=dev
  • or run on your favourite IDEs with VM arguments: -Dspring.profiles.active=dev Example in eclipse: add-arg-eclipse

Run in prod environment

  • In production environment, you just run:

      mvn clean install -DskipTests
      docker-compose up -d

Any modifications needed to be made to files/folders

Let's see some configurations in this project in the docker-compose.yml file:

  • db service: Informations that config the progres db with basic information of authentications, and mounted from docker container to host.

  • demo service: This our backend service runs depend on postgres db service (or another existing postgres db) in production and we must fill up these informations:

      - POSTGRES_HOST=db # db service name in docker-compose.yml file or ip/hostname of existing db
      - POSTGRES_PORT=5432 # opening port of database
      - POSTGRES_DB=demo #database name used by this project
      - POSTGRES_USER=postgres # username for authenticating
      - POSTGRES_PASSWORD=postgres # password for authenticating
      - ACTIVE_PROFILE=prod # specific application profile if have multiple profiles for multiple environments 

Authors

@tuanvayn

Version History

  • 0.1
    • Initial Release

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published