-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
57 lines (50 loc) · 1.3 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:
db:
image: mysql:8.0
container_name: criminal_mysql_db
environment:
- MYSQL_DATABASE=crime_schema
- MYSQL_USER=springstudent
- MYSQL_PASSWORD=springstudent
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 1m
timeout: 10s
retries: 3
networks:
- criminal_network
app:
build: .
ports:
- "8080:8080"
environment:
- SPRING_APPLICATION_NAME=criminal
- SPRING_DATASOURCE_URL=jdbc:mysql://db:3306/crime_schema
- SPRING_DATASOURCE_USERNAME=springstudent
- SPRING_DATASOURCE_PASSWORD=springstudent
- SPRING_MAIN_BANNER-MODE=off
- LOGGING_LEVEL_ROOT=warn
- LOGGING_LEVEL_ORG_HIBERNATE_SQL=warn
- LOGGING_LEVEL_ORG_HIBERNATE_ORM_JDBC_BIND=warn
- SPRING_JPA_HIBERNATE_DDL-AUTO=update
- SPRING_DATASOURCE_INITIALIZATION-MODE=always
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
interval: 1m
timeout: 10s
retries: 3
networks:
- criminal_network
networks:
criminal_network:
driver: bridge
volumes:
db_data: