forked from iSoftStoneGroup/EazyBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
162 lines (151 loc) · 4.25 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: "3"
services:
mysql:
image: mysql:8.0.19
container_name: mysql
# docker安全验证
security_opt:
- seccomp:unconfined
environment:
- MYSQL_ROOT_PASSWORD=root
volumes:
- ./mysql/lib/data:/var/lib/mysql
privileged: true
ports:
- "33066:3306"
nacos:
image: nacos/nacos-server:v2.1.1
container_name: nacos-v2.1.1
environment:
- PREFER_HOST_MODE=hostname
- MODE=standalone
- SPRING_DATASOURCE_PLATFORM=mysql
#mysql数据库地址
- MYSQL_SERVICE_HOST=mysql
# mysql端口
- MYSQL_SERVICE_PORT=3306
# mysql用户
- MYSQL_SERVICE_USER=root
# mysql密码
- MYSQL_SERVICE_PASSWORD=root
# nacos数据库
- MYSQL_SERVICE_DB_NAME=nacos
- MYSQL_SERVICE_DB_PARAM=useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
depends_on:
- mysql
redis:
container_name: redis
image: redis
ports:
- "36679:6379"
#指定挂载目录
#redis.conf文件和data目录分别映射了主机的redis.conf文件和主机的data目录
#使用command可以覆盖容器启动后默认执行的命令
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf:rw
- ./redis/data:/data:rw
privileged: true
command:
/bin/bash -c "redis-server /usr/local/etc/redis/redis.conf"
rabbitmq:
image: "rabbitmq:3.7.16-management"
environment:
RABBITMQ_DEFAULT_VHOST: "/devops"
RABBITMQ_DEFAULT_USER: "devops"
RABBITMQ_DEFAULT_PASS: "devops"
volumes:
- "./rabbitmq/data:/var/lib/rabbitmq"
privileged: true
ports:
- "35677:15672"
- "34369:4369"
- "35673:5672"
- "25672:25672"
jenkins:
image: jenkins/jenkins:lts
volumes:
- ./jenkins/data/jenkins_home:/var/jenkins_home
- ./jenkins/run/docker.sock:/var/run/docker.sock
- ./jenkins/bin/docker:/usr/bin/docker
- ./jenkins/lib/x86_64-linux-gnu/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7
privileged: true
ports:
- "8090:8080"
expose:
- "8080"
- "50000"
user: root
restart: always
container_name: jenkins
environment:
JAVA_OPTS: '-Djava.util.logging.config.file=/var/jenkins_home/log.properties'
postgres:
image: postgres:14.5
restart: always
container_name: postgres
ports:
- 30003:5432
volumes:
- ./postgres/postgresql:/var/lib/postgresql
- ./postgres/data:/var/lib/postgresql/data
privileged: true
environment:
TZ: Asia/Shanghai
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
POSTGRES_DB: sonar
sonarqube:
image: sonarqube:9.5.0-community
container_name: sonarqube
depends_on:
- postgres
volumes:
- ./sonarqube/extensions:/opt/sonarqube/extensions
- ./sonarqube/logs:/opt/sonarqube/logs
- ./sonarqube/data:/opt/sonarqube/data
- ./sonarqube/conf:/opt/sonarqube/conf
# 设置与宿主机时间同步
- /etc/localtime:/etc/localtime:ro
privileged: true
ports:
- 30004:9000
command:
# 内存设置
- -Dsonar.ce.javaOpts=-Xmx2048m
- -Dsonar.web.javaOpts=-Xmx2048m
# 设置服务代理路径
- -Dsonar.web.context=/
# 此设置用于集成gitlab时,回调地址设置
- -Dsonar.core.serverBaseURL=http://0.0.0.0:30004
environment:
TZ: Asia/Shanghai
SONARQUBE_JDBC_USERNAME: sonar
SONARQUBE_JDBC_PASSWORD: sonar
SONARQUBE_JDBC_URL: jdbc:postgresql://postgres:5432/sonar
eazybuilder-web:
build: ../eazybuilder-web/src/main/docker
ports:
- "30091:80"
volumes:
- ./nginx/config/conf.d/default.conf:/etc/nginx/conf.d/default.conf
- ./nginx/config/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/logs:/var/log/nginx/
privileged: true # 这个必须要,解决nginx的文件调用的权限问题
eazybuilder-server:
build:
context: ../eazybuilder-server/pipeline/jenkins-client/src/main/docker
dockerfile: Dockerfile
ports:
- "8080:8080"
depends_on:
- nacos
- mysql
- redis
- rabbitmq
- jenkins
- postgres
- sonarqube