-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
57 lines (52 loc) · 1.18 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: '3.8'
services:
spring-app:
image: maven:3.8.8-eclipse-temurin-17
container_name: spring-app-database-app
volumes:
- .:/app
working_dir: /app
command: mvn clean spring-boot:run
ports:
- "9090:9090"
depends_on:
- mysql
- mongo
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/ecommerce
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: 1234
SPRING_JPA_HIBERNATE_DDL_AUTO: update
SPRING_JPA_SHOW_SQL: "true"
SPRING_DATA_MONGODB_URI: mongodb://mongo:27017/ecommerce
SERVER_PORT: 9090
SERVER_SERVLET_CONTEXT_PATH: /ecommerce/api/v1
networks:
- spring-network
mysql:
image: mysql:8.0
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: 1234
MYSQL_DATABASE: ecommerce
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
networks:
- spring-network
mongo:
image: mongo:4.4
container_name: mongo
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
networks:
- spring-network
networks:
spring-network:
driver: bridge
volumes:
mysql_data:
mongo_data: