-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
38 lines (35 loc) · 851 Bytes
/
docker-compose.yml
File metadata and controls
38 lines (35 loc) · 851 Bytes
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
services:
spring-template:
build:
context: .
environment:
JAVA_OPTS: "-Dspring.datasource.url=jdbc:mysql://mysql:3306/spring_template
-Dspring.datasource.username=root
-Dspring.datasource.password=root"
ports:
- 8081:8080
depends_on:
mysql:
condition: service_healthy
networks:
- spring-template-dev
mysql:
image: mysql:8
environment:
MYSQL_DATABASE: 'spring_template'
MYSQL_ROOT_PASSWORD: 'root'
ports:
- 8080:8080
healthcheck:
test: mysql --user=root --password=$$MYSQL_ROOT_PASSWORD -e 'SHOW DATABASES;'
start_period: 5s
interval: 5s
retries: 3
volumes:
- spring-template-mysql:/var/lib/mysql
networks:
- spring-template-dev
volumes:
spring-template-mysql:
networks:
spring-template-dev: