This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.pub.yaml
55 lines (55 loc) · 1.76 KB
/
docker-compose.pub.yaml
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
version: '2.4.1'
services:
mysql-server:
image: mysql:8
container_name: mysql-server
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: 'xxxxxx'
volumes: # 需要挂载的文件卷,用于容器与主机之间共享文件
- /docker/mysql/data:/var/lib/mysql # 数据挂载
- /docker/mysql/conf:/etc/mysql/conf.d # 配置挂载
- /docker/mysql/init:/docker-entrypoint-initdb.d # 初始化sql挂载
restart: always
command: # docker run {args}
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
cache:
image: redis
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
volumes:
- /docker/redis/data:/data
- /docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
elasticsearch:
image: elasticsearch:7.17.3
container_name: elasticsearch
user: root
environment:
- "cluster.name=elasticsearch" #设置集群名称为elasticsearch
- "discovery.type=single-node" #以单一节点模式启动
- "ES_JAVA_OPTS=-Xms512m -Xmx1024m" #设置使用jvm内存大小
volumes:
- /docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins #插件文件挂载
- /docker/elasticsearch/data:/usr/share/elasticsearch/data #数据文件挂载
ports:
- 9200:9200
- 9300:9300
form-team-talent:
container_name: form-team-talent
build:
context: .
dockerfile: Dockerfile
volumes:
- /docker/app/form-team-talent:/docker/app/form-team-talent
depends_on:
- mysql-server
- redis
ports:
- 8080:8080
restart: always