-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
37 lines (37 loc) · 985 Bytes
/
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
version: '3.8'
services:
backend:
container_name: backend
build: .
restart: always
depends_on:
- mysql
network_mode: "host"
healthcheck:
test: ["CMD", "curl", '-f', "http://localhost:8010/health"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 5s
mysql:
image: mysql:8.0
container_name: cmysql
ports:
- "3306:3306"
volumes:
- /home/compuBackend/mysql/conf:/etc/mysql/conf.d
- /home/compuBackend/mysql/data:/var/lib/mysql
- /home/compuBackend/mysql/logs:/var/log/mysql
- /etc/localtime:/etc/localtime:ro
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: comback # 创建comback数据库
MYSQL_CHARSET: utf8mb4
MYSQL_COLLATION: utf8mb4_general_ci
restart: always
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -proot"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s