-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
45 lines (41 loc) · 1 KB
/
docker-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
38
39
40
41
42
43
44
45
services:
db:
image: mysql:8.0.34
restart: always
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
env_file: ./.env
environment:
- MYSQL_DATABASE=$DB
- MYSQL_ROOT_PASSWORD=$DB_ROOT_PASSWORD
- MYSQL_PASSWORD=$DB_PASSWORD
- MYSQL_USER=$DB_USER
ports:
- 3307:$DB_PORT
networks:
- this-api-net
volumes:
- db:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
app:
restart: on-failure
depends_on:
db:
condition: service_healthy
build: .
ports:
- 8080:8080
env_file: ./.env
environment:
- spring.datasource.username=$DB_USER
- spring.datasource.password=$DB_PASSWORD
- spring.datasource.url=jdbc:mysql://db:$DB_PORT/role_based_authorization?&useSSL=false&allowPublicKeyRetrieval=true
- spring.jpa.hibernate.ddl-auto=update
networks:
- this-api-net
volumes:
db:
networks:
this-api-net: