-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
46 lines (44 loc) · 1.19 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
45
46
version: '3.7'
services:
api:
image: shiyiya/yszm-api
build: .
restart: always
ports:
- ${APP_PORT}:8080
volumes:
- .:/app
env_file:
- .env
depends_on:
db:
condition: service_healthy
links:
- db
db:
image: mysql:5.7
restart: unless-stopped
platform: linux/amd64
# image: mysql/mysql-server # Apple M1
# command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
# command: --default-authentication-plugin=mysql_native_password
command:
- --default-authentication-plugin=mysql_native_password
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
ports:
- ${MYSQL_PORT}:3306
expose:
- ${MYSQL_PORT}
volumes:
- ./docker/import:/docker-entrypoint-initdb.d
- ./docker/mysql/my.cnf:/etc/my.cnf
- ./docker/mysql/data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_ROOT_HOST: '%'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$MYSQL_ROOT_PASSWORD']
timeout: 20s
retries: 5