-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (44 loc) · 1.55 KB
/
docker-compose.yml
File metadata and controls
47 lines (44 loc) · 1.55 KB
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
version: '3.8'
services:
# Java application
app:
build: . # build Dockerfile
ports:
- "8080:8080" # expose 8080 port
volumes:
- D:/release/licesnse/Aspose.Cells.lic:/app/license # optional : set Aspose license file
environment:
# database setting
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/gridjsdemodb?createDatabaseIfNotExist=true&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Jakarta&useSSL=false
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: root
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver
depends_on:
mysql:
condition: service_healthy # ensure MySQL run before app start
# MySQL service
mysql:
image: mysql:8.0 # use official MySQL 8.0 image
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: gridjsdemodb # create a database with name:gridjsdemodb
ports:
- "3306:3306" # local optional for debug
command: >
--default-authentication-plugin=mysql_native_password
--bind-address=0.0.0.0
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: |
bash -c '
mysqladmin ping -h localhost -u root -proot --silent > /dev/null 2>&1 &&
mysql -u root -proot -e "SELECT 1" > /dev/null 2>&1
'
interval: 5s
timeout: 10s
retries: 15
start_period: 10s
# volumn:persistent for MySQL data
volumes:
mysql-data: