docker-compose-yaml

docker-compose-yaml

docker-compose-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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
## 包含服务:mysql, redis, nginx, elasticsearch, kibana
## logstah, nacos/nacos-server, mongo, rabbitmq

version: '3'
services:
mysql:
image: mysql:5.7
container_name: mysql
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_ROOT_PASSWORD: root ## 设置root账号密码
ports:
- 3306:3306
volumes:
- /mydata/mysql/data/db:/var/lib/mysql ## 数据文件挂载
- /mydata/mysql/conf:/etc/mysql ## 配置文件挂载
- /mydata/mysql/log:/var/log/mysql ## 日志文件挂载
redis:
image: redis:6.2.6
container_name: redis
command: redis-server --appendonly yes
volumes:
- /mydata/redis/data:/data ## 数据文件挂载
ports:
- 6379:6379
nginx:
image: nginx:1.22
container_name: nginx
volumes:
- /mydata/nginx/conf:/etc/nginx ## 配置文件挂载
- /mydata/nginx/html:/usr/share/nginx/html
- /mydata/nginx/log:/var/log/nginx ## 日志文件
ports:
- 80:80
rabbitmq:
image: rabbitmq:3.9-management
container_name: rabbitmq
volumes:
- /mydata/rabbitmq/data:/var/lib/rabbitmq ## 数据文件挂载
ports:
- 5672:5672
- 15672:15672
# elasticsearch:
# image: elasticsearch:7.17.3
# container_name: elasticsearch
# user: root
# environment:
# - "cluster.name=elasticsearch" ## 设置集群名称为elasticsearch
# - "discovery.type=single-node" ##以单一节点模式启动
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ## 设置jvm堆内存大小
# volumes:
# - /mydata/elasticsearch/data:/var/lib/elasticsearch/data ## 数据文件挂载
# - /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins ## 插件文件挂载
# ports:
# - 9200:9200
# - 9300:9300
# logstash:
# image: elasticsearch:7.17.3
# container_name: logstash
# environment:
# - TZ=Asia/Shanghai
# volumes:
# - /mydata/logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf ## 挂载logstash.conf配置文件
# depends_on:
# - elasticsearch ## 在elasticsearch之后启动
# links:
# - elasticsearch:es ## 可以使用 es域名 访问elasticsearch服务
# ports:
# - 4560:4560
# - 4561:4561
# - 4562:4562
# - 4563:4563
# kibana:
# image: kibana:7.17.3
# container_name: kibana
# depends_on:
# - elasticsearch ## 在elasticsearch之后启动
# links:
# - elasticsearch:es ## 可以使用 es域名 访问elasticsearch服务
# ports:
# - 5601:5601
mongo:
image: mongo:6
container_name: mongo
volumes:
- /mydata/mongo/db:/data/db ## 数据卷挂载
ports:
- 27017:27017

nacos-registry:
image: nacos/nacos-server:v2.2.0
container_name: nacos-registry
environment:
- "MODE=standalone"
ports:
- 8848:8848
minio:
image: minio/minio
container_name: minio
command: server /data --console-address ":9001" #指定数据目录及console运行端口启动
environment:
- "MINIO_ACCESS_KEY=admin"
- "MINIO_SECRET_KEY=(八位密码)"
volumes:
- /mydata/minio/data:/data
ports:
- 9000:9000
- 9001:9001

logstash

1
2
3
4
5
6
output {
elasticsearch {
hosts => "es:9200"
index => "travel-%{type}-%{+YYYY.MM.dd}"
}
}

nginx.conf

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

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

server {
listen 80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

minio-compose.yaml

1
2
3
4
5
6
7
8
9
10
11
12
13
version: '3'
services:
minio:
image: minio/minio:lasest
container_name: minio
enviroment:
- "MINIO_ACCESS_KEY=admin"
- "MINIO_SECRET_KEY=admin"
volumnes:
-/mydata/minio/data:/data/minio
port:
- 9000:9000


docker-compose-yaml
http://example.com/2023/06/22/云原生-部署/docker-compose-yaml/
作者
where
发布于
2023年6月22日
许可协议