-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
37 lines (37 loc) · 1.02 KB
/
compose.yaml
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
version: '3.8'
services:
app:
depends_on:
- mysqldb
build: ./
restart: on-failure
env_file: .env
ports:
- ${SERVER_PORT}:${SERVER_PORT}
environment:
SPRING_APPLICATION_JSON: '{
"spring.datasource.url" : "jdbc:mysql://mysqldb:${MYSQL_PORT}/${MYSQL_DATABASE}?allowPublicKeyRetrieval=true&useSSL=false",
"spring.datasource.username" : "${MYSQL_USER}",
"spring.datasource.password" : "${MYSQL_PASSWORD}"
}'
stdin_open: true
tty: true
mysqldb:
image: mysql:8.0.36
env_file: .env
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
ports:
- ${MYSQL_PORT}:${MYSQL_PORT}
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", "-u", "root", "-p$${MYSQL_ROOT_PASSWORD}" ]
retries: 10
interval: 3s
timeout: 30s
volumes:
mysql-data: { }