-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
228 lines (216 loc) · 6.33 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
version: '3.4'
name: hotel-compose-d # doesn't work here when using vs to run Docker Compose
services:
consul:
container_name: consul
image: hashicorp/consul:1.16.1
restart: always
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:8500/ui/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
- consul-data:/consul
#- ./consul/config:/consul/config
#- ./consul/data:/consul/data
#- ./consul/logs:/consul/logs
command: "consul agent -server -bootstrap-expect=1 -client=0.0.0.0 -ui -bind='{{ GetPrivateIP }}' -data-dir=/consul/data -node=consul-node -datacenter=dc1 -log-level=debug -enable-script-checks=true -config-dir=/consul/config"
ports:
- "8500:8500"
- "8600:8600/udp"
networks:
- hotelnetwork
#---------------ELK-Kibana-------------
elasticsearch:
container_name: elk-els
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION}
ports:
- 9200:9200
volumes:
- elasticsearch-data:/usr/share/elasticsearch/datafile
environment:
- xpack.monitoring.enabled=true
- xpack.watcher.enabled=false
#- xpack.security.enabled=true
#- xpack.security.transport.ssl.enabled=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- discovery.type=single-node
#- ELASTIC_PASSWORD=elastic #password
networks:
- hotelnetwork
kibana:
container_name: elk-kibana
image: docker.elastic.co/kibana/kibana:${ES_KIBANA_VERSION}
ports:
- 5601:5601
depends_on:
- elasticsearch
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
- i18n.locale=zh-CN
#- ELASTICSEARCH_USERNAME=elastic
#- ELASTICSEARCH_PASSWORD=elastic #elastic password
networks:
- hotelnetwork
#---------------ELK-Kibana-------------
hotel:
image: ${DOCKER_REGISTRY-}hotel
container_name: hotel
ports:
- 9527:80
build:
context: .
dockerfile: Hotel/Dockerfile
#args:
# - "--network=host"
depends_on:
kibana:
condition: service_started
#required: false # not implementation for now
#sw-oap:
# condition: service_healthy
#required: false # not implementation for now
consul:
condition: service_healthy
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=SkyAPM.Agent.AspNetCore
#network_mode: host
#dns: 8.8.8.8 # single string value
#dns: # list
# - 8.8.8.8
# - 1.1.1.1
networks:
- hotelnetwork
##---------------SkyWalking-------------
##https://github.com/apache/skywalking/blob/master/docker/docker-compose.yml
#sw-elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION}
# container_name: sw-elasticsearch
# ports:
# - "9201:9200"
# healthcheck:
# test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1" ] #image inner cmd using port 9200
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 10s
# environment:
# - discovery.type=single-node
# - bootstrap.memory_lock=true
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
# ulimits:
# memlock:
# soft: -1
# hard: -1
# networks:
# - hotelnetwork
#sw-oap:
# image: ${OAP_IMAGE}
# container_name: sw-oap
# depends_on:
# sw-elasticsearch:
# condition: service_healthy
# links:
# - sw-elasticsearch
# ports:
# - "11800:11800"
# - "12800:12800"
# healthcheck:
# ##https://github.com/apache/skywalking/blob/master/test/e2e-v2/script/docker-compose/base-compose.yml
# #test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/11800"]
# test: [ "CMD-SHELL", "/skywalking/bin/swctl ch" ]
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 10s
# #volumes:
# # - ./../prepare/setup-oap/download-mysql.sh:/download-mysql.sh
# # - ./../prepare/setup-oap/log4j2.xml:/skywalking/config/log4j2.xml
# environment:
# SW_STORAGE: elasticsearch
# SW_STORAGE_ES_CLUSTER_NODES: sw-elasticsearch:9200
# SW_HEALTH_CHECKER: default
# SW_TELEMETRY: prometheus
# JAVA_OPTS: "-Xms2048m -Xmx2048m"
# networks:
# - hotelnetwork
#sw-ui:
# image: ${UI_IMAGE}
# container_name: sw-ui
# depends_on:
# sw-oap:
# condition: service_healthy
# links:
# - sw-oap
# ports:
# - "8087:8080"
# environment:
# SW_OAP_ADDRESS: http://sw-oap:12800
# SW_ZIPKIN_ADDRESS: http://sw-oap:9412
# networks:
# - hotelnetwork
##---------------SkyWalking-------------
#---------------Prometheus+Grafana-------------
pg-prometheus:
image: docker.io/bitnami/prometheus:2
container_name: pg-prometheus
ports:
- '9090:9090'
#configs:
# - source: prometheus_config
# target: /opt/bitnami/prometheus/conf/prometheus.yml
depends_on:
- hotel
volumes:
- prometheus-data:/opt/bitnami/prometheus/data
- ./Hotel/prometheus.yml:/opt/bitnami/prometheus/conf/prometheus.yml
networks:
- hotelnetwork
pg-cadvisor:
#image: gcr.io/cadvisor/cadvisor:latest
image: gcmirrors/cadvisor:latest #https://mirrors.kb.cx/
container_name: pg-cadvisor
ports:
- 8077:8080
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
networks:
- hotelnetwork
pg-grafana:
image : docker.io/bitnami/grafana:10
container_name: pg-grafana
depends_on:
- pg-prometheus
ports:
- "3003:3000"
environment:
- 'GF_SECURITY_ADMIN_PASSWORD=bitnami'
- 'GF_USERS_ALLOW_SIGN_UP=false'
volumes:
- grafana-data:/opt/bitnami/grafana/data
# optional config : https://github.com/djluck/prometheus-net.DotNetRuntime/blob/master/examples/docker-compose.yml#L42
#- ./grafana/data/:/var/lib/grafana
#- ./grafana/provisioning/:/etc/grafana/provisioning/
networks:
- hotelnetwork
#---------------Prometheus+Grafana-------------
configs:
prometheus_config:
file: ./prometheus.yml
networks:
hotelnetwork:
driver: bridge
#host:
# name: host
# external: true
volumes:
elasticsearch-data:
prometheus-data:
grafana-data:
consul-data: