Add docker compose for spring web modules
This commit is contained in:
parent
2779aef185
commit
1dc5609acd
1
docker-compose.env
Normal file
1
docker-compose.env
Normal file
@ -0,0 +1 @@
|
|||||||
|
APP_NAME="Spring Web Service with MongoDB"
|
28
docker-compose.yml
Normal file
28
docker-compose.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user