-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
44 lines (43 loc) · 1.55 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
version: "3"
services:
database_spring:
image: mysql:8
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: ${DATABASE_SPRING_PASSWORD}
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 20s
retries: 10
database_app:
image: mysql:8
ports:
- "3308:3306"
volumes:
- ./src/main/resources/scripts/database/database.sql:/docker-entrypoint-initdb.d/init.sql:ro
environment:
MYSQL_ROOT_PASSWORD: ${DATABASE_APP_PASSWORD}
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 20s
retries: 10
app:
build:
context: .
ports:
- 8080:8080
volumes:
- ./files/output:/app/files/output
depends_on:
database_spring:
condition: service_healthy
database_app:
condition: service_healthy
environment:
DATABASE_SPRING_USERNAME: ${DATABASE_SPRING_USERNAME}
DATABASE_SPRING_PASSWORD: ${DATABASE_SPRING_PASSWORD}
SPRING_DATASOURCE_JDBC_URL: jdbc:mysql://database_spring:3306/spring_batch?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useTimezone=true&serverTimezone=UTC&allowPublicKeyRetrieval=true
DATABASE_APP_USERNAME: ${DATABASE_APP_USERNAME}
DATABASE_APP_PASSWORD: ${DATABASE_APP_PASSWORD}
APP_DATASOURCE_JDBC_URL: jdbc:mysql://database_app:3306/app_batch?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useTimezone=true&serverTimezone=UTC&allowPublicKeyRetrieval=true