Skip to content

Commit d79e675

Browse files
committed
feat: serilog & seq
feat: favicon fix: docker-compose
1 parent f0831cc commit d79e675

File tree

73 files changed

+612
-288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+612
-288
lines changed

docker/docker-compose-local-light.yml

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,6 @@ version: "3"
22

33
services:
44

5-
generate-pfx:
6-
image: emberstack/openssl
7-
container_name: generate-pfx
8-
volumes:
9-
- ./certs:/https:rw
10-
command: >
11-
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
12-
rm /https/devstore.academy-localhost.pfx &&
13-
openssl genrsa -out devstore.rsa 2048 &&
14-
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
15-
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
16-
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
17-
rm devstore.rsa devstore.csr devstore.crt)"
18-
19-
devstore-rabbit:
20-
image: rabbitmq:3-management
21-
container_name: devstore-rabbit
22-
ports:
23-
- 5672:5672
24-
- 15672:15672
25-
environment:
26-
RABBITMQ_DEFAULT_USER: "devstore"
27-
RABBITMQ_DEFAULT_PASS: "devstore"
28-
295
web-mvc:
306
image: desenvolvedorio/devstore-web-mvc-ecommerce:latest
317
container_name: devstore-web-mvc-ecommerce
@@ -48,14 +24,24 @@ services:
4824
- api-bff-checkout
4925
- generate-pfx
5026

27+
devstore-rabbit:
28+
image: rabbitmq:3-management
29+
container_name: devstore-rabbit
30+
expose:
31+
- 5672
32+
environment:
33+
RABBITMQ_DEFAULT_USER: "devstore"
34+
RABBITMQ_DEFAULT_PASS: "devstore"
35+
RABBITMQ_DEFAULT_VHOST: "/"
36+
5137
database-devstore:
52-
image: mcr.microsoft.com/mssql/server:2017-latest
53-
container_name: database-devstore
54-
ports:
55-
- 1433:1433
56-
environment:
57-
SA_PASSWORD: "MyDB@123"
58-
ACCEPT_EULA: "Y"
38+
image: mcr.microsoft.com/mssql/server:2017-latest
39+
container_name: database-devstore
40+
expose:
41+
- 1433
42+
environment:
43+
SA_PASSWORD: "MyDB@123"
44+
ACCEPT_EULA: "Y"
5945

6046
api-identity:
6147
image: desenvolvedorio/devstore-api-identity:latest
@@ -210,15 +196,37 @@ services:
210196
- api-identity
211197
- generate-pfx
212198

199+
generate-pfx:
200+
image: emberstack/openssl
201+
container_name: generate-pfx
202+
volumes:
203+
- ./certs:/https:rw
204+
command: >
205+
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
206+
rm /https/devstore.academy-localhost.pfx &&
207+
openssl genrsa -out devstore.rsa 2048 &&
208+
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
209+
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
210+
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
211+
rm devstore.rsa devstore.csr devstore.crt)"
212+
213+
seq:
214+
image: datalust/seq:latest
215+
expose:
216+
- 5341
217+
ports:
218+
- 5341:80
219+
environment:
220+
ACCEPT_EULA: Y
221+
213222
devstore-server:
214-
image: desenvolvedorio/devstore-server:latest
223+
image: nginx
215224
container_name: devstore-server
216-
build:
217-
context: ./
218-
dockerfile: ./nginx/Dockerfile
219225
restart: always
220226
volumes:
221-
- ./nginx/conf.d:/etc/nginx/conf.d:ro
227+
- ./nginx/devstore.conf:/etc/nginx/conf.d/default.conf:ro
228+
- ./nginx/nerdstore-certificate.key:/etc/nginx/nerdstore-certificate.key:ro
229+
- ./nginx/nerdstore-certificate.pem:/etc/nginx/nerdstore-certificate.pem:ro
222230
ports:
223231
- "7500:80"
224232
- "7501:443"

docker/docker-compose-local.yml

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,6 @@ version: "3"
22

33
services:
44

5-
generate-pfx:
6-
image: emberstack/openssl
7-
container_name: generate-pfx
8-
volumes:
9-
- ./certs:/https:rw
10-
command: >
11-
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
12-
rm /https/devstore.academy-localhost.pfx &&
13-
openssl genrsa -out devstore.rsa 2048 &&
14-
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
15-
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
16-
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
17-
rm devstore.rsa devstore.csr devstore.crt)"
18-
19-
devstore-rabbit:
20-
image: rabbitmq:3-management
21-
container_name: devstore-rabbit
22-
ports:
23-
- 5672:5672
24-
- 15672:15672
25-
environment:
26-
RABBITMQ_DEFAULT_USER: "devstore"
27-
RABBITMQ_DEFAULT_PASS: "devstore"
28-
295
web-mvc:
306
image: desenvolvedorio/devstore-web-mvc-ecommerce:latest
317
container_name: devstore-web-mvc-ecommerce
@@ -47,6 +23,17 @@ services:
4723
- api-customers
4824
- api-bff-checkout
4925
- generate-pfx
26+
27+
devstore-rabbit:
28+
image: rabbitmq:3-management
29+
container_name: devstore-rabbit
30+
ports:
31+
- 5672:5672
32+
- 15672:15672
33+
environment:
34+
RABBITMQ_DEFAULT_USER: "devstore"
35+
RABBITMQ_DEFAULT_PASS: "devstore"
36+
5037

5138
database-identity:
5239
image: mcr.microsoft.com/mssql/server:2017-latest
@@ -256,15 +243,37 @@ services:
256243
- api-identity
257244
- generate-pfx
258245

246+
seq:
247+
image: datalust/seq:latest
248+
expose:
249+
- 5341
250+
ports:
251+
- 5341:80
252+
environment:
253+
ACCEPT_EULA: Y
254+
255+
# This service is used to generate the PFX file for gRPC communication
256+
generate-pfx:
257+
image: emberstack/openssl
258+
container_name: generate-pfx
259+
volumes:
260+
- ./certs:/https:rw
261+
command: >
262+
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
263+
rm /https/devstore.academy-localhost.pfx &&
264+
openssl genrsa -out devstore.rsa 2048 &&
265+
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
266+
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
267+
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
268+
rm devstore.rsa devstore.csr devstore.crt)"
269+
259270
devstore-server:
260-
image: desenvolvedorio/devstore-server:latest
261-
container_name: devstore-server
262-
build:
263-
context: ./
264-
dockerfile: ./nginx/Dockerfile
271+
image: nginx
265272
restart: always
266273
volumes:
267-
- ./nginx/conf.d:/etc/nginx/conf.d:ro
274+
- ./nginx/devstore.conf:/etc/nginx/conf.d/default.conf:ro
275+
- ./nginx/nerdstore-certificate.key:/etc/nginx/nerdstore-certificate.key:ro
276+
- ./nginx/nerdstore-certificate.pem:/etc/nginx/nerdstore-certificate.pem:ro
268277
ports:
269278
- "7500:80"
270279
- "7501:443"

docker/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ services:
228228
- api-identity
229229
- generate-pfx
230230

231+
seq:
232+
image: datalust/seq:latest
233+
expose:
234+
- 5341
235+
ports:
236+
- 5341:80
237+
environment:
238+
ACCEPT_EULA: Y
239+
231240
devstore-server:
232241
image: desenvolvedorio/devstore-server:latest
233242
container_name: devstore-server

docker/nginx/Dockerfile

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

docker/nginx/conf.d/devstore.conf renamed to docker/nginx/devstore.conf

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@ upstream web-mvc {
33
server web-mvc:5001;
44
}
55

6-
upstream rabbitmq {
7-
least_conn;
8-
server devstore-rabbit:15672;
9-
}
10-
116
server {
127
listen 80;
13-
server_name $hostname;
8+
server_name localhost;
149

1510
location / {
16-
# Google doesn't like 302 redirects, so we use a 301 here
17-
return 301 https://$host:7501$request_uri;
11+
proxy_pass http://web-mvc;
1812
}
13+
# location / {
14+
# # Google doesn't like 302 redirects, so we use a 301 here
15+
# return 302 https://$host:7501$request_uri;
16+
# }
1917
}
2018

2119
server {
@@ -24,10 +22,8 @@ server {
2422

2523
ssl_protocols TLSv1.2 TLSv1.3;
2624
ssl_ciphers HIGH:!aNULL:!MD5;
27-
2825
ssl_certificate /etc/nginx/nerdstore-certificate.pem;
2926
ssl_certificate_key /etc/nginx/nerdstore-certificate.key;
30-
3127
location / {
3228
proxy_pass http://web-mvc;
3329
proxy_redirect off;
@@ -39,5 +35,4 @@ server {
3935
proxy_set_header X-Forwarded-Proto $scheme;
4036
proxy_set_header X-Forwarded-Host $server_name;
4137
}
42-
4338
}

docker/teste.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Binary file not shown.
-566 Bytes
Binary file not shown.

src/api-gateways/DevStore.Bff.Checkout/appsettings.Development.json

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
{
2-
"Logging": {
3-
"LogLevel": {
2+
"Serilog": {
3+
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.Seq" ],
4+
"MinimumLevel": {
45
"Default": "Information",
5-
"Microsoft": "Warning",
6-
"Microsoft.Hosting.Lifetime": "Information"
6+
"Override": {
7+
"Microsoft.AspNetCore": "Warning",
8+
"Microsoft.EntityFrameworkCore": "Information"
9+
}
10+
},
11+
"WriteTo": [
12+
{ "Name": "Console" },
13+
{
14+
"Name": "Seq",
15+
"Args": {
16+
"serverUrl": "http://localhost:5341"
17+
}
18+
}
19+
],
20+
"Enrich": [ "FromLogContext" ],
21+
"Properties": {
22+
"Application": "BffCheckout"
723
}
824
},
925
"AllowedHosts": "*",

src/api-gateways/DevStore.Bff.Checkout/appsettings.Docker.json

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
{
2-
"Logging": {
3-
"LogLevel": {
2+
"Serilog": {
3+
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.Seq" ],
4+
"MinimumLevel": {
45
"Default": "Information",
5-
"Microsoft": "Warning",
6-
"Microsoft.Hosting.Lifetime": "Information"
6+
"Override": {
7+
"Microsoft.AspNetCore": "Warning",
8+
"Microsoft.EntityFrameworkCore": "Information"
9+
}
10+
},
11+
"WriteTo": [
12+
{ "Name": "Console" },
13+
{
14+
"Name": "Seq",
15+
"Args": {
16+
"serverUrl": "http://seq:5341"
17+
}
18+
}
19+
],
20+
"Enrich": [ "FromLogContext" ],
21+
"Properties": {
22+
"Application": "BffCheckout"
723
}
824
},
925
"AllowedHosts": "*",

src/api-gateways/DevStore.Bff.Checkout/appsettings.Production.json

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
{
2-
"Logging": {
3-
"LogLevel": {
4-
"Default": "Information",
5-
"Microsoft": "Warning",
6-
"Microsoft.Hosting.Lifetime": "Information"
2+
"Serilog": {
3+
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.Seq" ],
4+
"MinimumLevel": {
5+
"Default": "Warning",
6+
"Override": {
7+
"Microsoft.AspNetCore": "Warning",
8+
"Microsoft.EntityFrameworkCore": "Error"
9+
}
10+
},
11+
"WriteTo": [
12+
{ "Name": "Console" },
13+
{
14+
"Name": "Seq",
15+
"Args": {
16+
"serverUrl": "http://seqs:5341"
17+
}
18+
}
19+
],
20+
"Enrich": [ "FromLogContext" ],
21+
"Properties": {
22+
"Application": "BffCheckout"
723
}
824
},
925
"AllowedHosts": "*",

src/api-gateways/DevStore.Bff.Checkout/appsettings.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
{
2-
"Logging": {
3-
"LogLevel": {
4-
"Default": "Information",
5-
"Microsoft": "Warning",
6-
"Microsoft.Hosting.Lifetime": "Information"
7-
}
8-
},
92
"AllowedHosts": "*",
103
"AppSettings": {
114
"Issuer": "https://devstore.academy",
Binary file not shown.
Binary file not shown.
Binary file not shown.
-566 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)