Skip to content

Commit

Permalink
feat: serilog & seq
Browse files Browse the repository at this point in the history
feat: favicon
fix: docker-compose
  • Loading branch information
brunobritodev committed Apr 20, 2022
1 parent f0831cc commit d79e675
Show file tree
Hide file tree
Showing 73 changed files with 612 additions and 288 deletions.
80 changes: 44 additions & 36 deletions docker/docker-compose-local-light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@ version: "3"

services:

generate-pfx:
image: emberstack/openssl
container_name: generate-pfx
volumes:
- ./certs:/https:rw
command: >
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
rm /https/devstore.academy-localhost.pfx &&
openssl genrsa -out devstore.rsa 2048 &&
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
rm devstore.rsa devstore.csr devstore.crt)"
devstore-rabbit:
image: rabbitmq:3-management
container_name: devstore-rabbit
ports:
- 5672:5672
- 15672:15672
environment:
RABBITMQ_DEFAULT_USER: "devstore"
RABBITMQ_DEFAULT_PASS: "devstore"

web-mvc:
image: desenvolvedorio/devstore-web-mvc-ecommerce:latest
container_name: devstore-web-mvc-ecommerce
Expand All @@ -48,14 +24,24 @@ services:
- api-bff-checkout
- generate-pfx

devstore-rabbit:
image: rabbitmq:3-management
container_name: devstore-rabbit
expose:
- 5672
environment:
RABBITMQ_DEFAULT_USER: "devstore"
RABBITMQ_DEFAULT_PASS: "devstore"
RABBITMQ_DEFAULT_VHOST: "/"

database-devstore:
image: mcr.microsoft.com/mssql/server:2017-latest
container_name: database-devstore
ports:
- 1433:1433
environment:
SA_PASSWORD: "MyDB@123"
ACCEPT_EULA: "Y"
image: mcr.microsoft.com/mssql/server:2017-latest
container_name: database-devstore
expose:
- 1433
environment:
SA_PASSWORD: "MyDB@123"
ACCEPT_EULA: "Y"

api-identity:
image: desenvolvedorio/devstore-api-identity:latest
Expand Down Expand Up @@ -210,15 +196,37 @@ services:
- api-identity
- generate-pfx

generate-pfx:
image: emberstack/openssl
container_name: generate-pfx
volumes:
- ./certs:/https:rw
command: >
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
rm /https/devstore.academy-localhost.pfx &&
openssl genrsa -out devstore.rsa 2048 &&
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
rm devstore.rsa devstore.csr devstore.crt)"
seq:
image: datalust/seq:latest
expose:
- 5341
ports:
- 5341:80
environment:
ACCEPT_EULA: Y

devstore-server:
image: desenvolvedorio/devstore-server:latest
image: nginx
container_name: devstore-server
build:
context: ./
dockerfile: ./nginx/Dockerfile
restart: always
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/devstore.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/nerdstore-certificate.key:/etc/nginx/nerdstore-certificate.key:ro
- ./nginx/nerdstore-certificate.pem:/etc/nginx/nerdstore-certificate.pem:ro
ports:
- "7500:80"
- "7501:443"
Expand Down
69 changes: 39 additions & 30 deletions docker/docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@ version: "3"

services:

generate-pfx:
image: emberstack/openssl
container_name: generate-pfx
volumes:
- ./certs:/https:rw
command: >
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
rm /https/devstore.academy-localhost.pfx &&
openssl genrsa -out devstore.rsa 2048 &&
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
rm devstore.rsa devstore.csr devstore.crt)"
devstore-rabbit:
image: rabbitmq:3-management
container_name: devstore-rabbit
ports:
- 5672:5672
- 15672:15672
environment:
RABBITMQ_DEFAULT_USER: "devstore"
RABBITMQ_DEFAULT_PASS: "devstore"

web-mvc:
image: desenvolvedorio/devstore-web-mvc-ecommerce:latest
container_name: devstore-web-mvc-ecommerce
Expand All @@ -47,6 +23,17 @@ services:
- api-customers
- api-bff-checkout
- generate-pfx

devstore-rabbit:
image: rabbitmq:3-management
container_name: devstore-rabbit
ports:
- 5672:5672
- 15672:15672
environment:
RABBITMQ_DEFAULT_USER: "devstore"
RABBITMQ_DEFAULT_PASS: "devstore"


database-identity:
image: mcr.microsoft.com/mssql/server:2017-latest
Expand Down Expand Up @@ -256,15 +243,37 @@ services:
- api-identity
- generate-pfx

seq:
image: datalust/seq:latest
expose:
- 5341
ports:
- 5341:80
environment:
ACCEPT_EULA: Y

# This service is used to generate the PFX file for gRPC communication
generate-pfx:
image: emberstack/openssl
container_name: generate-pfx
volumes:
- ./certs:/https:rw
command: >
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
rm /https/devstore.academy-localhost.pfx &&
openssl genrsa -out devstore.rsa 2048 &&
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
rm devstore.rsa devstore.csr devstore.crt)"
devstore-server:
image: desenvolvedorio/devstore-server:latest
container_name: devstore-server
build:
context: ./
dockerfile: ./nginx/Dockerfile
image: nginx
restart: always
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/devstore.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/nerdstore-certificate.key:/etc/nginx/nerdstore-certificate.key:ro
- ./nginx/nerdstore-certificate.pem:/etc/nginx/nerdstore-certificate.pem:ro
ports:
- "7500:80"
- "7501:443"
Expand Down
9 changes: 9 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ services:
- api-identity
- generate-pfx

seq:
image: datalust/seq:latest
expose:
- 5341
ports:
- 5341:80
environment:
ACCEPT_EULA: Y

devstore-server:
image: desenvolvedorio/devstore-server:latest
container_name: devstore-server
Expand Down
4 changes: 0 additions & 4 deletions docker/nginx/Dockerfile

This file was deleted.

17 changes: 6 additions & 11 deletions docker/nginx/conf.d/devstore.conf → docker/nginx/devstore.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ upstream web-mvc {
server web-mvc:5001;
}

upstream rabbitmq {
least_conn;
server devstore-rabbit:15672;
}

server {
listen 80;
server_name $hostname;
server_name localhost;

location / {
# Google doesn't like 302 redirects, so we use a 301 here
return 301 https://$host:7501$request_uri;
proxy_pass http://web-mvc;
}
# location / {
# # Google doesn't like 302 redirects, so we use a 301 here
# return 302 https://$host:7501$request_uri;
# }
}

server {
Expand All @@ -24,10 +22,8 @@ server {

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;

ssl_certificate /etc/nginx/nerdstore-certificate.pem;
ssl_certificate_key /etc/nginx/nerdstore-certificate.key;

location / {
proxy_pass http://web-mvc;
proxy_redirect off;
Expand All @@ -39,5 +35,4 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $server_name;
}

}
17 changes: 0 additions & 17 deletions docker/teste.yml

This file was deleted.

Binary file modified src/api-gateways/DevStore.Bff.Checkout/DevStore.Bff.Checkout.csproj
Binary file not shown.
Binary file modified src/api-gateways/DevStore.Bff.Checkout/Program.cs
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{
"Logging": {
"LogLevel": {
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.Seq" ],
"MinimumLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
"Override": {
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"WriteTo": [
{ "Name": "Console" },
{
"Name": "Seq",
"Args": {
"serverUrl": "http://localhost:5341"
}
}
],
"Enrich": [ "FromLogContext" ],
"Properties": {
"Application": "BffCheckout"
}
},
"AllowedHosts": "*",
Expand Down
24 changes: 20 additions & 4 deletions src/api-gateways/DevStore.Bff.Checkout/appsettings.Docker.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{
"Logging": {
"LogLevel": {
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.Seq" ],
"MinimumLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
"Override": {
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"WriteTo": [
{ "Name": "Console" },
{
"Name": "Seq",
"Args": {
"serverUrl": "http://seq:5341"
}
}
],
"Enrich": [ "FromLogContext" ],
"Properties": {
"Application": "BffCheckout"
}
},
"AllowedHosts": "*",
Expand Down
26 changes: 21 additions & 5 deletions src/api-gateways/DevStore.Bff.Checkout/appsettings.Production.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.Seq" ],
"MinimumLevel": {
"Default": "Warning",
"Override": {
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Error"
}
},
"WriteTo": [
{ "Name": "Console" },
{
"Name": "Seq",
"Args": {
"serverUrl": "http://seqs:5341"
}
}
],
"Enrich": [ "FromLogContext" ],
"Properties": {
"Application": "BffCheckout"
}
},
"AllowedHosts": "*",
Expand Down
7 changes: 0 additions & 7 deletions src/api-gateways/DevStore.Bff.Checkout/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"AppSettings": {
"Issuer": "https://devstore.academy",
Expand Down
Binary file modified src/building-blocks/DevStore.MessageBus/IMessageBus.cs
Binary file not shown.
Binary file modified src/building-blocks/DevStore.MessageBus/MessageBus.cs
Binary file not shown.
Binary file modified src/services/DevStore.Billing.API/DevStore.Billing.API.csproj
Binary file not shown.
Binary file modified src/services/DevStore.Billing.API/Program.cs
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit d79e675

Please sign in to comment.