-
Notifications
You must be signed in to change notification settings - Fork 223
/
docker-compose-server.yml
60 lines (58 loc) · 1.71 KB
/
docker-compose-server.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
55
56
57
58
59
60
version: '3.3'
services:
# 构建 MySQL数据库 这里不指定数据库文件 防止误操作 等隐患问题
opsli-boot-mysql:
build: ./db-file/2.0版本
image: opsli-boot-mysql
restart: always
environment:
# root 账户默认密码 生产时请更改
MYSQL_ROOT_PASSWORD: 123456
MYSQL_ROOT_HOST: '%'
TZ: Asia/Shanghai
LANG: en_US.UTF-8
container_name: opsli-boot-mysql
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
--max_allowed_packet=128M
--default-authentication-plugin=caching_sha2_password
volumes:
- /var/mysql/data:/var/lib/mysql #挂载 MySQL数据
ports:
- "3306:3306"
# 构建 Redis
opsli-boot-redis:
image: redis:6.2.3
restart: always
container_name: opsli-boot-redis
environment:
TZ: Asia/Shanghai
LANG: en_US.UTF-8
command: redis-server /usr/local/etc/redis/redis.conf --appendonly yes # 表示通过挂载配置文件追加配置
volumes:
- /var/redis/data:/data #挂载 Redis数据
- /var/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf #挂载 Redis配置
ports:
- "6379:6379"
opsli-boot:
build: ./
restart: on-failure
container_name: opsli-boot
image: opsli-boot
environment:
TZ: Asia/Shanghai
LANG: en_US.UTF-8
command:
- -Xmx2048m
- -Xms2048m
- -XX:+UseG1GC
- -XX:MaxGCPauseMillis=200
- --spring.profiles.active=test
privileged: true
volumes:
- /www/wwwroot/demo.opsli.bedebug.com/backend/run:/usr/local/opsli/opsli-boot #挂载目录
ports:
- "7000:7000"