Add docker compose for spring web modules

This commit is contained in:
Sambo Chea 2021-12-21 12:01:21 +07:00
parent 2779aef185
commit 1dc5609acd
Signed by: sombochea
GPG Key ID: 3C7CF22A05D95490
2 changed files with 29 additions and 0 deletions

1
docker-compose.env Normal file
View File

@ -0,0 +1 @@
APP_NAME="Spring Web Service with MongoDB"

28
docker-compose.yml Normal file
View File

@ -0,0 +1,28 @@
version: "3.7"
services:
spring-web-api:
container_name: spring-web-api
build:
context: .
dockerfile: Dockerfile
ports:
- 8080:8080
depends_on:
- mongo
env_file:
- docker-compose.env
mongo:
image: mongo
container_name: mongo
restart: always
ports:
- 27017:27017
env_file:
- docker-compose.env
volumes:
- mongo:/data/db
volumes:
mongo:
name: spring-web-db