-
Notifications
You must be signed in to change notification settings - Fork 61
/
docker-compose-dce.yml
139 lines (136 loc) · 3.95 KB
/
docker-compose-dce.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
version: "3"
services:
sonarqube:
image: "sonarqube:${TAG}-app"
depends_on:
search-1:
condition: service_healthy
search-2:
condition: service_healthy
search-3:
condition: service_healthy
networks:
- sonar-network
cpus: 0.5
mem_limit: 4096M
mem_reservation: 1024M
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
SONAR_WEB_PORT: 9000
SONAR_CLUSTER_SEARCH_HOSTS: "search-1,search-2,search-3"
SONAR_CLUSTER_HOSTS: "sonarqube"
SONAR_AUTH_JWTBASE64HS256SECRET: "dZ0EB0KxnF++nr5+4vfTCaun/eWbv6gOoXodiAMqcFo="
VIRTUAL_HOST: sonarqube.dev.local
VIRTUAL_PORT: 9000
volumes:
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
search-1:
image: "sonarqube:${TAG}-search"
hostname: "search-1"
cpus: 0.5
mem_limit: 4096M
mem_reservation: 1024M
depends_on:
- db
networks:
- sonar-network
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
SONAR_CLUSTER_ES_HOSTS: "search-1,search-2,search-3"
SONAR_CLUSTER_NODE_NAME: "search-1"
volumes:
- search-data-1:/opt/sonarqube/data
healthcheck:
test: wget --no-proxy -qO- "http://$$SONAR_CLUSTER_NODE_NAME:9001/_cluster/health?wait_for_status=yellow&timeout=50s" | grep -q -e '"status":"green"' -e '"status":"yellow"'; if [ $? -eq 0 ]; then exit 0; else exit 1; fi
interval: 25s
timeout: 1s
retries: 3
start_period: 55s
search-2:
image: "sonarqube:${TAG}-search"
hostname: "search-2"
cpus: 0.5
mem_limit: 4096M
mem_reservation: 1024M
depends_on:
- db
networks:
- sonar-network
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
SONAR_CLUSTER_ES_HOSTS: "search-1,search-2,search-3"
SONAR_CLUSTER_NODE_NAME: "search-2"
volumes:
- search-data-2:/opt/sonarqube/data
healthcheck:
test: wget --no-proxy -qO- "http://$$SONAR_CLUSTER_NODE_NAME:9001/_cluster/health?wait_for_status=yellow&timeout=50s" | grep -q -e '"status":"green"' -e '"status":"yellow"'; if [ $? -eq 0 ]; then exit 0; else exit 1; fi
interval: 25s
timeout: 1s
retries: 3
start_period: 55s
search-3:
image: "sonarqube:${TAG}-search"
hostname: "search-3"
cpus: 0.5
mem_limit: 4096M
mem_reservation: 1024M
depends_on:
- db
networks:
- sonar-network
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
SONAR_CLUSTER_ES_HOSTS: "search-1,search-2,search-3"
SONAR_CLUSTER_NODE_NAME: "search-3"
volumes:
- search-data-3:/opt/sonarqube/data
healthcheck:
test: wget --no-proxy -qO- "http://$$SONAR_CLUSTER_NODE_NAME:9001/_cluster/health?wait_for_status=yellow&timeout=50s" | grep -q -e '"status":"green"' -e '"status":"yellow"'; if [ $? -eq 0 ]; then exit 0; else exit 1; fi
interval: 25s
timeout: 1s
retries: 3
start_period: 55s
db:
image: postgres:13
networks:
- sonar-network
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- sonar-network
- sonar-public
networks:
sonar-network:
ipam:
driver: default
config:
- subnet: 172.28.2.0/24
sonar-public:
driver: bridge
volumes:
sonarqube_extensions:
sonarqube_logs:
search-data-1:
search-data-2:
search-data-3:
postgresql:
postgresql_data: