-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.mysql.yml
54 lines (51 loc) · 1.26 KB
/
docker-compose.mysql.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
version: '3.8'
services:
mysql:
container_name: goraebab_mysql
image: mysql:latest
ports:
- "3306:3306"
volumes:
- ./db/mysql:/docker-entrypoint-initdb.d
environment:
MYSQL_ROOT_PASSWORD: root
command:
- "mysqld"
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_unicode_ci"
networks:
goraebab_network:
ipv4_address: 172.18.0.20
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 10s
retries: 5
backend:
container_name: goraebab_spring
image: spring:latest
build:
context: ./
ports:
- "2387:2387"
- "5005:5005"
environment:
spring.profiles.active: mysql
spring.datasource.url: jdbc:mysql://172.18.0.20:3306/goraebab
spring.datasource.username: root
spring.datasource.password: root
spring.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
depends_on:
mysql:
condition: service_healthy
networks:
goraebab_network:
ipv4_address: 172.18.0.10
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
goraebab_network:
name: goraebab_network
ipam:
driver: default
config:
- subnet: 172.18.0.0/16