forked from mlogclub/bbs-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (50 loc) · 1.55 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
47
48
49
50
51
52
53
54
version: '3.8'
services:
mysql:
container_name: bbs-go-mysql
image: 'mysql:8.0'
environment:
TZ: Asia/Shanghai
MYSQL_DATABASE: bbsgo_db
MYSQL_USER: bbsgo
MYSQL_PASSWORD: 123456
MYSQL_ROOT_PASSWORD: 123456
volumes:
- .docker-compose/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d # 初始化脚本件目录, 这个目录中的.sh/sql文件会以字母顺序依次执行
# - ./mysql:/var/lib/mysql # 挂载数据件目录.如果非root账号执行,挂载目录必须是登录账号下目录
# - .docker-compose/mysql/conf.d:/etc/mysql/conf.d # 挂在配置文件目录
restart: always
healthcheck:
test: '/usr/bin/mysql --user=bbsgo --password=123456 bbsgo_db --execute "SHOW TABLES;"'
interval: 3s
timeout: 300s
retries: 100
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
server:
container_name: bbs-go-server
image: mlogclub/bbs-go-server:latest
depends_on:
mysql:
condition: service_healthy
ports:
- 8082:8082
build:
dockerfile: Dockerfile
context: ./server
volumes:
- /data/docker:/data
- ./server/bbs-go.docker.yaml:/app/bbs-go.docker.yaml
restart: on-failure
site:
container_name: bbs-go-site
image: mlogclub/bbs-go-site:latest
depends_on:
- server
ports:
- 3000:3000
build:
dockerfile: Dockerfile
context: ./site
volumes:
- ./site/nuxt.config.docker.js:/app/bbs-go/nuxt.config.js
restart: on-failure