Skip to content

Commit c3c6488

Browse files
committed
Add .env template, update appsettings for Docker compatibility, and modify service configurations
1 parent 992c33d commit c3c6488

File tree

16 files changed

+103
-194
lines changed

16 files changed

+103
-194
lines changed

README.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ You can use **Docker compose** to setup the infrastructure components just by ru
7373

7474
``` bash
7575
cd ./containers
76-
# Setup the infrastructure
76+
# Setup the infrastructure. Use this file to setup the basic infrastructure components (RabbitMQ, MongoDB)
7777
docker compose -f ./infrastructure.yml --env-file ./.env --project-name genocs up -d
7878

79-
# Use this file only in case you want to setup Redis and Postgres db (no need if you use mongo)
79+
# Use this file only in case you want to setup Redis and PostgreSQL (no need if you use MongoDB)
8080
docker compose -f ./infrastructure-db.yml --env-file ./.env --project-name genocs up -d
8181

8282
# Use this file only in case you want to setup monitoring infrastructure components (Prometheus, Grafana, InfluxDB, Jaeger, Seq)
@@ -88,13 +88,13 @@ docker compose -f ./infrastructure-scaling.yml --env-file ./.env --project-name
8888
# Use this file only in case you want to setup security infrastructure components (Vault)
8989
docker compose -f ./infrastructure-security.yml --env-file ./.env --project-name genocs up -d
9090

91-
# Use this file only in case you want to setup sqlserver database (no need if you use postgres)
91+
# Use this file only in case you want to setup sqlserver database (no need if you use PostgreSQL)
9292
docker compose -f ./infrastructure-sqlserver.yml --env-file ./.env --project-name genocs up -d
9393

94-
# Use this file only in case you want to setup mySql database (no need if you use postgres)
94+
# Use this file only in case you want to setup mySql database (no need if you use PostgreSQL)
9595
docker compose -f ./infrastructure-mysql.yml --env-file ./.env --project-name genocs up -d
9696

97-
# Use this file only in case you want to setup oracle database (no need if you use postgres)
97+
# Use this file only in case you want to setup oracle database (no need if you use PostgreSQL)
9898
docker compose -f ./infrastructure-oracle.yml --env-file ./.env --project-name genocs up -d
9999

100100
# Use this file only in case you want to setup elk stack
@@ -104,18 +104,24 @@ docker compose -f ./infrastructure-elk.yml --env-file ./.env --project-name geno
104104
docker compose -f ./infrastructure-ml.yml --env-file ./.env --project-name genocs up -d
105105
```
106106

107-
`infrastructure-bare.yml` allows to install the basic infrastructure components. They are:
107+
`infrastructure.yml` allows to install the basic infrastructure components. They are:
108108
- [RabbitMQ](https://rabbitmq.com)
109109
- [Redis](https://redis.io)
110110
- [MongoDB](https://mongodb.com)
111-
- [Postgres](https://www.postgresql.org/).
111+
- [Postgres](https://www.postgresql.org/)
112112

113-
You can run them locally:
113+
114+
`infrastructure-db.yml` allows to install Redis and PostgreSQL
115+
- [Redis](https://redis.io)
116+
- [Postgres](https://www.postgresql.org/)
117+
118+
119+
You can check them locally:
114120

115121
- [RabbitMQ](http://localhost:15672): `localhost:15672`
116-
- Redis: `localhost:6379`
117-
- MongoDB: `localhost:27017`
118-
- Postgres: `localhost:5432`
122+
- Redis: `TCP:localhost:6379`
123+
- MongoDB: `TCP:localhost:27017`
124+
- Postgres: `TCP:localhost:5432`
119125

120126

121127
`infrastructure-monitoring.yml` allows to install the monitoring infrastructure components. They are:
@@ -126,7 +132,7 @@ You can run them locally:
126132
- [Seq](https://datalust.co/seq)
127133

128134

129-
You can run them locally:
135+
You can find the console locally at:
130136

131137
- [Prometheus](localhost:9090): `localhost:9090`
132138
- [Grafana](localhost:3000): `localhost:3000`
@@ -135,9 +141,13 @@ You can run them locally:
135141
- [Seq](localhost:5341): `localhost:5341`
136142

137143

138-
`infrastructure-scaling.yml` allows to install the scaling infrastructure components. They are:
139-
- Fabio
140-
- Consul
144+
`infrastructure-scaling.yml` allows to install the scaling infrastructure components composed by Fabio and Consul.
145+
146+
- [Fabio](https://fabiolb.net/)
147+
- [Consul](https://www.consul.io/)
148+
149+
150+
141151

142152
`infrastructure-security.yml` allows to install the security infrastructure components.
143153

@@ -185,7 +195,7 @@ Use [**api-workbench**](./api-workbench.rest) inside Visual Studio code with [RE
185195
"enabled": false,
186196
"url": "http://localhost:8500",
187197
"service": "demo-service",
188-
"address": "docker.for.win.localhost",
198+
"address": "docker.for.mac.localhost",
189199
"port": "5070",
190200
"pingEnabled": true,
191201
"pingEndpoint": "health",

containers/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file is a template for the .env file that is used by the docker-compose.yml file.
2+
POSTGRES_PASSWORD=mySecretPassword1234!

src/Genocs.Core.Demo.Worker/appsettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
"enabled": false,
4444
"url": "http://localhost:8500",
4545
"service": "users-service",
46-
"address": "docker.for.win.localhost",
46+
"address": "docker.for.mac.localhost",
4747
"port": "5070",
4848
"pingEnabled": true,
49-
"pingEndpoint": "ping",
49+
"pingEndpoint": "alive",
5050
"pingInterval": 3,
5151
"removeAfterInterval": 3
5252
},

src/Genocs.Discovery.Consul/Genocs.Discovery.Consul.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@
3030

3131
<ItemGroup>
3232
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.*" />
33-
<PackageReference Include="Polly" Version="8.5.0" />
3433
</ItemGroup>
3534
</Project>

src/Genocs.LoadBalancing.Fabio/Genocs.LoadBalancing.Fabio.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,4 @@
2828
<PackageReference Include="Genocs.HTTP" Version="7.0.0" />
2929
<PackageReference Include="Genocs.Discovery.Consul" Version="7.0.0" />
3030
</ItemGroup>
31-
32-
<ItemGroup>
33-
<PackageReference Include="Polly" Version="8.5.0" />
34-
</ItemGroup>
35-
3631
</Project>

src/apps/api-gateway/Genocs.APIGateway/Properties/launchSettings.json

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
{
2-
"iisSettings": {
3-
"windowsAuthentication": false,
4-
"anonymousAuthentication": true,
5-
"iisExpress": {
6-
"applicationUrl": "http://localhost:5000"
7-
}
8-
},
92
"profiles": {
10-
"Genocs.APIGateway": {
3+
"Local": {
114
"commandName": "Project",
125
"launchBrowser": true,
13-
"applicationUrl": "http://localhost:5000",
14-
"environmentVariables": {
15-
"ASPNETCORE_ENVIRONMENT": "development"
16-
}
17-
},
18-
"IIS Express": {
19-
"commandName": "IISExpress",
20-
"launchBrowser": true,
6+
"applicationUrl": "https://localhost:5500;http://localhost:5501",
217
"environmentVariables": {
228
"ASPNETCORE_ENVIRONMENT": "development"
239
}

src/apps/api-gateway/Genocs.APIGateway/appsettings.development.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/apps/api-gateway/Genocs.APIGateway/appsettings.json

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,12 @@
77
"displayBanner": true,
88
"displayVersion": true
99
},
10-
"jaeger": {
11-
"enabled": true,
12-
"serviceName": "api-gateway",
13-
"udpHost": "localhost",
14-
"maxPacketSize": 65000
15-
},
16-
"jwt": {
17-
"certificate": {
18-
"location": "certs/localhost.cer"
19-
},
20-
"issuer": "genocs-identity-service",
21-
"validIssuer": "genocs-identity-service",
22-
"validateAudience": false,
23-
"validateIssuer": true,
24-
"validateLifetime": true,
25-
"expiry": "01:00:00"
26-
},
2710
"logger": {
2811
"level": "debug",
2912
"excludePaths": [
3013
"/",
31-
"/ping",
14+
"/health",
15+
"/alive",
3216
"/metrics"
3317
],
3418
"excludeProperties": [
@@ -64,22 +48,22 @@
6448
},
6549
"tags": {}
6650
},
67-
"messaging": {
51+
"jwt": {
52+
"certificate": {
53+
"location": "certs/localhost.cer"
54+
},
55+
"issuer": "genocs-identity-service",
56+
"validIssuer": "genocs-identity-service",
57+
"validateAudience": false,
58+
"validateIssuer": true,
59+
"validateLifetime": true,
60+
"expiry": "01:00:00"
61+
},
62+
"jaeger": {
6863
"enabled": true,
69-
"endpoints": [
70-
{
71-
"method": "post",
72-
"path": "stories-service/stories/async",
73-
"exchange": "stories",
74-
"routingKey": "send_story"
75-
},
76-
{
77-
"method": "post",
78-
"path": "stories-service/stories/{storyId}/rate/async",
79-
"exchange": "stories",
80-
"routingKey": "rate_story"
81-
}
82-
]
64+
"serviceName": "api-gateway",
65+
"udpHost": "localhost",
66+
"maxPacketSize": 65000
8367
},
8468
"prometheus": {
8569
"enabled": false,
@@ -179,28 +163,28 @@
179163
"identity-cluster": {
180164
"destinations": {
181165
"destination1": {
182-
"address": "https://localhost:5011"
166+
"address": "https://localhost:5510"
183167
}
184168
}
185169
},
186170
"products-cluster": {
187171
"destinations": {
188172
"destination1": {
189-
"address": "http://localhost:5002"
173+
"address": "https://localhost:5520"
190174
}
191175
}
192176
},
193177
"orders-cluster": {
194178
"destinations": {
195179
"destination1": {
196-
"address": "http://localhost:5003"
180+
"address": "https://localhost:5530"
197181
}
198182
}
199183
},
200184
"signalr-cluster": {
201185
"destinations": {
202186
"destination1": {
203-
"address": "http://localhost:5004"
187+
"address": "https://localhost:5540"
204188
}
205189
}
206190
}
@@ -236,4 +220,4 @@
236220
}
237221
}
238222
}
239-
}
223+
}
Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
11
{
2-
"iisSettings": {
3-
"windowsAuthentication": false,
4-
"anonymousAuthentication": true,
5-
"iisExpress": {
6-
"applicationUrl": "http://localhost:61699/",
7-
"sslPort": 44323
8-
}
9-
},
102
"profiles": {
11-
"Genocs.Core.Demo.Users.WebApi": {
3+
"Local": {
124
"commandName": "Project",
135
"launchBrowser": true,
6+
"applicationUrl": "https://localhost:5510;http://localhost:5511",
147
"environmentVariables": {
158
"ASPNETCORE_ENVIRONMENT": "Development"
16-
},
17-
"IIS Express": {
18-
"commandName": "IISExpress",
19-
"launchBrowser": true,
20-
"environmentVariables": {
21-
"ASPNETCORE_ENVIRONMENT": "Development"
22-
}
23-
},
24-
"applicationUrl": "https://localhost:5011;http://localhost:5001"
9+
}
2510
}
2611
}
2712
}

src/apps/identity/Genocs.Identities.WebApi/appsettings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"enabled": false,
3333
"url": "http://localhost:8500",
3434
"service": "identity-service",
35-
"address": "docker.for.win.localhost",
36-
"port": "5070",
35+
"address": "docker.for.mac.localhost",
36+
"port": "5511",
3737
"pingEnabled": true,
38-
"pingEndpoint": "ping",
38+
"pingEndpoint": "alive",
3939
"pingInterval": 3,
4040
"removeAfterInterval": 3
4141
},

0 commit comments

Comments
 (0)