forked from mabdulahmalik/Lines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
223 lines (212 loc) · 7.39 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
name: sol
services:
linesapp:
container_name: app.lines
profiles:
- app
build:
context: ./
dockerfile: ./Platform/src/SOL.Gateway/Dockerfile
depends_on:
rabbitmq:
condition: service_healthy
azuresql:
condition: service_started
azurestorage:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_started
hostname: app.lines.local
ports:
- 5051:80
environment:
- VITE_API_URL=http://localhost:5051/graphql/
- VITE_WS_API_URL=ws://localhost:5051/graphql/
- VITE_REPORT_SERVICE_URL=http://localhost:5052
- ASPNETCORE_URLS=http://+:80
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__TenantDb=Server=svc.sqldb.local;Database=CustomerDb;User Id=sa;Password=P@ssw0rd!;Persist Security Info=False;Encrypt=False
- ConnectionStrings__AzureStorage=AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://host.docker.internal:10000/devstoreaccount1;QueueEndpoint=http://host.docker.internal:10001/devstoreaccount1;TableEndpoint=http://host.docker.internal:10002/devstoreaccount1;
- ConnectionStrings__RedisCache=svc.cache.local:6379
- Keycloak__BaseUrl=http://host.docker.internal:5050
- Keycloak__ClientId=lines-app
- Keycloak__ClientSecret=z9JZfyBnkTkZDqqOiODL4lF7JUAuS6iz
- RabbitMQ__Host=svc.msgque.local
- RabbitMQ__Username=guest
- RabbitMQ__Password=guest
- AppUrlRoot=http://127.0.0.1:10000/devstoreaccount1
- KeycloakUrl=http://localhost:5050/
- OtlpUrl=http://svc.jaeger.local:4318/v1/traces
svcmesh:
container_name: app.svcmesh
profiles:
- app
build:
context: ./Platform/src
dockerfile: SOL.ServiceMesh/Dockerfile
depends_on:
rabbitmq:
condition: service_healthy
azuresql:
condition: service_started
azurestorage:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_started
hostname: app.svcmesh.local
ports:
- 5053:80
environment:
- ASPNETCORE_URLS=http://+:80
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__TenantDb=Server=svc.sqldb.local;Database=CustomerDb;User Id=sa;Password=P@ssw0rd!;Persist Security Info=False;Encrypt=False
- ConnectionStrings__AzureStorage=AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://host.docker.internal:10000/devstoreaccount1;QueueEndpoint=http://host.docker.internal:10001/devstoreaccount1;TableEndpoint=http://host.docker.internal:10002/devstoreaccount1;
- ConnectionStrings__RedisCache=svc.cache.local:6379
- Keycloak__BaseUrl=http://host.docker.internal:5050
- Keycloak__ClientId=lines-app
- Keycloak__ClientSecret=z9JZfyBnkTkZDqqOiODL4lF7JUAuS6iz
- RabbitMQ__Host=svc.msgque.local
- RabbitMQ__Username=guest
- RabbitMQ__Password=guest
- AppUrlRoot=http://127.0.0.1:10000/devstoreaccount1
- KeycloakUrl=http://localhost:5050/
- OtlpUrl=http://svc.jaeger.local:4318/v1/traces
reporting:
container_name: app.reporting
profiles:
- reporting
- app
build:
context: ./Platform/src
dockerfile: SOL.Reporting/Dockerfile
hostname: app.reporting.local
ports:
- 5052:80
environment:
- ASPNETCORE_URLS=http://+:80
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__CustomerDb=Server=svc.sqldb.local;Database=CustomerDb;User Id=sa;Password=P@ssw0rd!;Persist Security Info=False;Encrypt=False
- OtlpUrl=http://svc.jaeger.local:4318/v1/traces
dataseeder:
container_name: app.seeder
profiles:
- seeder
build:
context: ./Platform/dbo
dockerfile: Dockerfile
depends_on:
- mssqltools
keycloak:
container_name: app.keycloak
profiles:
- app
build:
dockerfile: Dockerfile
context: ./Keycloak/Docker
hostname: app.keycloak.local
ports:
- 5050:8080
- 9000:9000
depends_on:
- azuresql
volumes:
- './Keycloak/Docker/themes:/opt/keycloak/themes'
- './Keycloak/Docker/import:/opt/keycloak/data/import'
- './Keycloak/Docker/export:/opt/keycloak/data/export'
environment:
- KC_DB_URL=jdbc:sqlserver://svc.sqldb.local:1433;databaseName=Keycloak;encrypt=true;trustServerCertificate=true;
- KC_DB_USERNAME=sa
- KC_DB_PASSWORD=P@ssw0rd!
- KC_HOSTNAME= # must be set in production
- KC_HOSTNAME_STRICT=false # must be set to true in production.
- KC_HTTPS_CERTIFICATE_FILE=/cert/localhost.crt
- KC_HTTPS_CERTIFICATE_KEY_FILE=/cert/localhost.key
- KC_HTTP_ENABLED=true # for local testing
- KC_HEALTH_ENABLED=true
- KC_METRICS_ENABLED=true
- KC_MGMT_PORT=9000 # Expose management port
# healthcheck:
# test: ["CMD", "wget --spider http://localhost:9000/health/started || exit 1"]
# interval: 10s
# timeout: 5s
# retries: 3
mssqltools:
container_name: svc.sqltools
image: mcr.microsoft.com/mssql-tools
profiles:
- seeder
command: /bin/bash -c '/opt/mssql-tools/bin/sqlcmd -S svc.sqldb.local -U sa -P "P@ssw0rd!" -Q "USE master; ALTER DATABASE [CustomerDb] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DROP DATABASE [CustomerDb]; ALTER DATABASE [Keycloak] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DROP DATABASE [Keycloak]; CREATE DATABASE [Keycloak];";'
depends_on:
- azuresql
rabbitmq:
container_name: svc.msgque
image: masstransit/rabbitmq:3.13.1
hostname: svc.msgque.local
ports:
- 5672:5672
- 15672:15672
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 5s
timeout: 10s
retries: 5
start_period: 3s
redis:
container_name: svc.cache
image: redis/redis-stack:7.4.0-v0
hostname: svc.cache.local
ports:
- 6379:6379
- 8001:8001
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 10s
retries: 5
start_period: 3s
azuresql:
container_name: svc.sqldb
image: mcr.microsoft.com/mssql/server:2022-latest
hostname: svc.sqldb.local
platform: linux/amd64
ports:
- 1433:1433
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=P@ssw0rd!
- MSSQL_PID=Developer
# healthcheck:
# test: ["CMD", "sqlcmd", "-U", "sa", "-P", "P@ssw0rd!", "-Q", "SELECT 1"]
# interval: 5s
# timeout: 10s
# retries: 5
# start_period: 3s
azurestorage:
container_name: svc.storage
image: mcr.microsoft.com/azure-storage/azurite:latest
command: 'azurite --loose --blobHost 0.0.0.0 --blobPort 10000 --queueHost 0.0.0.0 --queuePort 10001 --location /workspace --debug /workspace/debug.log'
hostname: svc.storage.local
ports:
- 10000:10000
- 10001:10001
- 10002:10002
healthcheck:
test: nc 127.0.0.1 10000 -z
interval: 5s
timeout: 10s
retries: 5
start_period: 3s
jaeger:
container_name: svc.jaeger
image: jaegertracing/jaeger:2.2.0
hostname: svc.jaeger.local
ports:
- 16686:16686
- 4317:4317
- 4318:4318
- 5778:5778
- 9411:9411