forked from BehzadDara/SampleProject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.override.yml
229 lines (212 loc) · 7 KB
/
docker-compose.override.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
229
version: '3.4'
services:
sampleprojectdb:
container_name: sampleprojectdb
environment:
- SA_PASSWORD=Admin1234!!
- ACCEPT_EULA=Y
restart: always
ports:
- 8600:1433
networks:
- sampleproject_network
sampleproject.api:
container_name: sampleproject.api
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8001
- ConnectionStrings:DefaultConnection=Server=sampleprojectdb;Database=SampleProjectDB;User Id=sa;Password=Admin1234!!;TrustServerCertificate=True;
# Connect sampleprojectdb in SSMS using IpConfig -> Ethernet adapter vEthernet (WSL) -> Ip V4
- ConnectionStrings:RedisConnection=redis:6379,defaultdatabase=11
# Check redis content -> docker exec -it redis redis-cli
- HealthCheck:Uri=http://sampleproject.api:8001/healthz
- RabbitMQSettings:HostName=rabbitmq
- RabbitMQSettings:UserName=user
- RabbitMQSettings:Password=password
ports:
- "18001:8001"
depends_on:
- sampleprojectdb
- rabbitmq
volumes:
- ${APPDATA}/Microsoft/UserSecrets:/home/app/.microsoft/usersecrets:ro
- ${APPDATA}/ASP.NET/Https:/home/app/.aspnet/https:ro
networks:
- sampleproject_network
healthcheck:
interval: 30s
timeout: 10s
retries: 5
# Health check and retry is for this purpose:
# RabbitMQ and Sender (AnotherSampleProject) should start first. Then SampleProject is able to be up...
anothersampleprojectdb:
container_name: anothersampleprojectdb
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=Admin1234
- POSTGRES_DB=anothersampleprojectdb
restart: always
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data/
networks:
- sampleproject_network
anothersampleproject.api1:
container_name: anothersampleproject.api1
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8002
- ConnectionStrings:DefaultConnection=Server=anothersampleprojectdb;Port=5432;Database=anothersampleprojectdb;User Id=postgres;Password=Admin1234
- RabbitMQSettings:HostName=rabbitmq
- RabbitMQSettings:UserName=user
- RabbitMQSettings:Password=password
depends_on:
- anothersampleprojectdb
- rabbitmq
ports:
- 8002:8002
networks:
- sampleproject_network
anothersampleproject.api2:
container_name: anothersampleproject.api2
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8002
- ConnectionStrings:DefaultConnection=Server=anothersampleprojectdb;Port=5432;Database=anothersampleprojectdb;User Id=postgres;Password=Admin1234
- RabbitMQSettings:HostName=rabbitmq
- RabbitMQSettings:UserName=user
- RabbitMQSettings:Password=password
depends_on:
- anothersampleprojectdb
- rabbitmq
ports:
- 8003:8002
networks:
- sampleproject_network
anothersampleproject.api3:
container_name: anothersampleproject.api3
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8002
- ConnectionStrings:DefaultConnection=Server=anothersampleprojectdb;Port=5432;Database=anothersampleprojectdb;User Id=postgres;Password=Admin1234
- RabbitMQSettings:HostName=rabbitmq
- RabbitMQSettings:UserName=user
- RabbitMQSettings:Password=password
depends_on:
- anothersampleprojectdb
- rabbitmq
ports:
- 8004:8002
networks:
- sampleproject_network
anothersampleproject.loadbalancer:
container_name: anothersampleproject.loadbalancer
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8010
- ReverseProxy:Routes:api-route:ClusterId=api-cluster
- ReverseProxy:Routes:api-route:Match:Path={**catch-all}
- ReverseProxy:Clusters:api-cluster:LoadBalancingPolicy=RoundRobin
- ReverseProxy:Clusters:api-cluster:HealthCheck:Active:Enabled=true
- ReverseProxy:Clusters:api-cluster:HealthCheck:Active:Interval=00:00:05
- ReverseProxy:Clusters:api-cluster:HealthCheck:Active:Timeout=00:00:05
- ReverseProxy:Clusters:api-cluster:HealthCheck:Active:Policy=ConsecutiveFailures
- ReverseProxy:Clusters:api-cluster:HealthCheck:Active:Path=/healthz
- ReverseProxy:Clusters:api-cluster:Destinations:destination1:Address=http://anothersampleproject.api1:8002
- ReverseProxy:Clusters:api-cluster:Destinations:destination1:Health:Active=http://anothersampleproject.api1:8002/healthz
- ReverseProxy:Clusters:api-cluster:Destinations:destination2:Address=http://anothersampleproject.api2:8002
- ReverseProxy:Clusters:api-cluster:Destinations:destination2:Health:Active=http://anothersampleproject.api2:8002/healthz
- ReverseProxy:Clusters:api-cluster:Destinations:destination3:Address=http://anothersampleproject.api3:8002
- ReverseProxy:Clusters:api-cluster:Destinations:destination3:Health:Active=http://anothersampleproject.api3:8002/healthz
ports:
- 8010:8010
networks:
- sampleproject_network
prometheus:
container_name: prometheus
volumes:
- ./prometheus/prometheus.yml:/etc/Monitoring/prometheus.yml
ports:
- "9090:9090"
depends_on:
- sampleproject.api
networks:
- sampleproject_network
grafana:
container_name: grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
ports:
- "3700:3000"
depends_on:
- prometheus
networks:
- sampleproject_network
redis:
container_name: redis
ports:
- "6379:6379"
- "9101:8001"
networks:
- sampleproject_network
elasticsearch:
container_name: elasticsearch
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
environment:
- discovery.type=single-node
- xpack.security.enabled=false
ports:
- "9200:9200"
- "9300:9300"
networks:
- sampleproject_network
# not working !
kibana:
container_name: kibana
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
- XPACK_SECURITY_ENABLED=false
ports:
- "15601:5601"
depends_on:
- elasticsearch
networks:
- sampleproject_network
# not working !
pgadmin:
container_name: pgadmin
environment:
- PGADMIN_DEFAULT_PASSWORD=admin1234
restart: always
ports:
- 5050:80
volumes:
- pgadmin_data:/root/.pgadmin
networks:
- sampleproject_network
portainer:
container_name: portainer
restart: always
ports:
- 9000:9000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
networks:
- sampleproject_network
rabbitmq:
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: password
networks:
- sampleproject_network
networks:
sampleproject_network:
driver: bridge