diff --git a/SwiftParcel.API.Gateway/src/SwiftParcel.API.Gateway/production.appsettings.json b/SwiftParcel.API.Gateway/src/SwiftParcel.API.Gateway/production.appsettings.json new file mode 100644 index 0000000..58c0b40 --- /dev/null +++ b/SwiftParcel.API.Gateway/src/SwiftParcel.API.Gateway/production.appsettings.json @@ -0,0 +1,27 @@ +{ + "logger": { + "excludePaths": ["/", "/ping", "/metrics"], + "console": { + "enabled": true + }, + "file": { + "enabled": true, + "path": "logs/logs.txt", + "interval": "day" + }, + "seq": { + "enabled": true, + "url": "http://seq:5341", + "apiKey": "secret" + } + }, + "metrics": { + "enabled": true, + "influxEnabled": false, + "prometheusEnabled": true, + "influxUrl": "http://influx:8086", + "database": "swiftparcel", + "env": "local", + "interval": 5 + } +} \ No newline at end of file diff --git a/SwiftParcel.ExternalAPI.Lecturer/src/SwiftParcel.ExternalAPI.Lecturer.Api/SwiftParcel.ExternalAPI.Lecturer.Api/appsettings.json b/SwiftParcel.ExternalAPI.Lecturer/src/SwiftParcel.ExternalAPI.Lecturer.Api/SwiftParcel.ExternalAPI.Lecturer.Api/appsettings.json index 377300a..8e670ed 100644 --- a/SwiftParcel.ExternalAPI.Lecturer/src/SwiftParcel.ExternalAPI.Lecturer.Api/SwiftParcel.ExternalAPI.Lecturer.Api/appsettings.json +++ b/SwiftParcel.ExternalAPI.Lecturer/src/SwiftParcel.ExternalAPI.Lecturer.Api/SwiftParcel.ExternalAPI.Lecturer.Api/appsettings.json @@ -6,10 +6,10 @@ }, "consul": { "enabled": true, - "url": "http://consul:8500", + "url": "http://localhost:8500", "service": "lecturer-api-service", - "address": "lecturer-api-service", - "port": "80", + "address": "docker.for.win.localhost", + "port": "5013", "pingEnabled": true, "pingEndpoint": "ping", "pingInterval": 3, @@ -17,11 +17,11 @@ }, "fabio": { "enabled": false, - "url": "http://fabio:9999", + "url": "http://localhost:9999", "service": "lecturer-api-service" }, "httpClient": { - "type": "direct", + "type": "", "retries": 3, "services": { "lecturer-api": "https://mini.currier.api.snet.com.pl", @@ -57,7 +57,7 @@ "mongo": { "type": "database", "roleName": "lecturer-api-service", - "enabled": false, + "enabled": true, "autoRenewal": true, "templates": { "connectionString": "mongodb+srv://andrii-courier-db-user:piotr-amadeusz-andrii-2023@cluster0.br51nsv.mongodb.net/?retryWrites=true&w=majority" @@ -129,7 +129,7 @@ "virtualHost": "/", "port": 5672, "hostnames": [ - "rabbitmq" + "localhost" ], "requestedConnectionTimeout": "00:00:30", "requestedHeartbeat": "00:01:00", diff --git a/SwiftParcel.ExternalAPI.Lecturer/src/SwiftParcel.ExternalAPI.Lecturer.Api/SwiftParcel.ExternalAPI.Lecturer.Api/production.appsettings.json b/SwiftParcel.ExternalAPI.Lecturer/src/SwiftParcel.ExternalAPI.Lecturer.Api/SwiftParcel.ExternalAPI.Lecturer.Api/production.appsettings.json new file mode 100644 index 0000000..aefdcb1 --- /dev/null +++ b/SwiftParcel.ExternalAPI.Lecturer/src/SwiftParcel.ExternalAPI.Lecturer.Api/SwiftParcel.ExternalAPI.Lecturer.Api/production.appsettings.json @@ -0,0 +1,161 @@ +{ + "app": { + "name": "SwiftParcel Lecturer API Service", + "service": "lecturer-api-service", + "version": "1" + }, + "consul": { + "enabled": true, + "url": "http://consul:8500", + "service": "lecturer-api-service", + "address": "lecturer-api-service", + "port": "80", + "pingEnabled": true, + "pingEndpoint": "ping", + "pingInterval": 3, + "removeAfterInterval": 3 + }, + "fabio": { + "enabled": false, + "url": "http://fabio:9999", + "service": "lecturer-api-service" + }, + "httpClient": { + "type": "direct", + "retries": 3, + "services": { + "lecturer-api": "https://mini.currier.api.snet.com.pl", + "lecturer-api-identity": "https://indentitymanager.snet.com.pl/connect/token" + }, + "token": "dGVhbTJkOkVBQUE1MEI4LTkwQ0ItNDM2RS05ODY0LTRCQzc1QjU2RjNCRQ==", + "requestMasking": { + "enabled": true, + "maskTemplate": "*****" + } + }, + "AllowedHosts": "*", + "vault": { + "enabled": false, + "url": "http://127.0.0.1:8200", + "authType": "userpass", + "token": "secret", + "username": "user", + "password": "piotr-amadeusz-andrii-2023", + "dbusername": "andrii-courier-db-user", + "kv": { + "enabled": true, + "engineVersion": 2, + "mountPoint": "secret", + "path": "lecturer-api-service/settings" + }, + "pki": { + "enabled": false, + "roleName": "lecturer-api-service", + "commonName": "lecturer-api-service.swiftparcel.com" + }, + "lease": { + "mongo": { + "type": "database", + "roleName": "lecturer-api-service", + "enabled": false, + "autoRenewal": true, + "templates": { + "connectionString": "mongodb+srv://andrii-courier-db-user:piotr-amadeusz-andrii-2023@cluster0.br51nsv.mongodb.net/?retryWrites=true&w=majority" + } + } + } + }, + "logger": { + "level": "information", + "excludePaths": ["/", "/ping", "/metrics"], + "excludeProperties": [ + "api_key", + "access_key", + "ApiKey", + "ApiSecret", + "ClientId", + "ClientSecret", + "ConnectionString", + "Password", + "Email", + "Login", + "Secret", + "Token" + ], + "console": { + "enabled": true + }, + "elk": { + "enabled": false, + "url": "http://localhost:9200" + }, + "file": { + "enabled": true, + "path": "logs/logs.txt", + "interval": "day" + }, + "seq": { + "enabled": true, + "url": "http://localhost:5341", + "apiKey": "secret" + }, + "tags": {} + }, + "swagger": { + "enabled": true, + "reDocEnabled": false, + "name": "v1", + "title": "API", + "version": "v1", + "routePrefix": "docs", + "includeSecurity": true + }, + + "mongo": { + "connectionString": "mongodb+srv://andrii-courier-db-user:piotr-amadeusz-andrii-2023@cluster0.br51nsv.mongodb.net/?retryWrites=true&w=majority", + "database": "lecturer-api-service", + "seed": false + }, + "rabbitMq": { + "connectionName": "lecturer-api-service", + "retries": 3, + "retryInterval": 2, + "conventionsCasing": "snakeCase", + "logger": { + "enabled": true + }, + "username": "guest", + "password": "guest", + "virtualHost": "/", + "port": 5672, + "hostnames": [ + "rabbitmq" + ], + "requestedConnectionTimeout": "00:00:30", + "requestedHeartbeat": "00:01:00", + "socketReadTimeout": "00:00:30", + "socketWriteTimeout": "00:00:30", + "continuationTimeout": "00:00:20", + "handshakeContinuationTimeout": "00:00:10", + "networkRecoveryInterval": "00:00:05", + "exchange": { + "declare": true, + "durable": true, + "autoDelete": false, + "type": "topic", + "name": "identity" + }, + "queue": { + "declare": true, + "durable": true, + "exclusive": false, + "autoDelete": false, + "template": "lecturer-api-service/{{exchange}}.{{message}}" + }, + "context": { + "enabled": true, + "header": "message_context" + }, + "spanContextHeader": "span_context" + } +} diff --git a/SwiftParcel/d-docker-compose/services.yml b/SwiftParcel/d-docker-compose/services.yml index 7136cdc..2e94d38 100644 --- a/SwiftParcel/d-docker-compose/services.yml +++ b/SwiftParcel/d-docker-compose/services.yml @@ -5,6 +5,8 @@ services: identity-service: image: adrianvsaint/swift-parcel-identity-service container_name: identity-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5292:80 @@ -14,6 +16,8 @@ services: web: image: adrianvsaint/swift-parcel-web container_name: swiftparcel-web + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 3001:80 @@ -23,6 +27,8 @@ services: deliveries-service: image: adrianvsaint/swift-parcel-deliveries-service container_name: deliveries-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5003:80 @@ -32,6 +38,8 @@ services: parcels-service: image: adrianvsaint/swift-parcel-parcels-service container_name: parcels-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5007:80 @@ -41,6 +49,8 @@ services: pricing-service: image: adrianvsaint/swift-parcel-pricing-service container_name: pricing-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5008:80 @@ -50,6 +60,8 @@ services: customers-service: image: adrianvsaint/swift-parcel-customers-service container_name: customers-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5002:80 @@ -59,6 +71,8 @@ services: orders-service: image: adrianvsaint/swift-parcel-orders-service container_name: orders-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5006:80 @@ -68,6 +82,8 @@ services: lecturer-api-service: image: adrianvsaint/swift-parcel-external-api-lecturer-service container_name: lecturer-api-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5004:80 @@ -77,6 +93,8 @@ services: api-gateway: image: adrianvsaint/swift-parcel-apigateway-service container_name: api-gateway + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped environment: - NTRADA_CONFIG=ntrada.yml diff --git a/SwiftParcel/deployment.yml b/SwiftParcel/deployment.yml index 50f0579..36279db 100644 --- a/SwiftParcel/deployment.yml +++ b/SwiftParcel/deployment.yml @@ -5,6 +5,8 @@ identity-service: image: adrianvsaint/swift-parcel-identity-service container_name: identity-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5292:80 @@ -14,6 +16,8 @@ web: image: adrianvsaint/swift-parcel-web container_name: swiftparcel-web + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 3001:80 @@ -23,6 +27,8 @@ deliveries-service: image: adrianvsaint/swift-parcel-deliveries-service container_name: deliveries-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5003:80 @@ -32,6 +38,8 @@ parcels-service: image: adrianvsaint/swift-parcel-parcels-service container_name: parcels-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5007:80 @@ -41,6 +49,8 @@ pricing-service: image: adrianvsaint/swift-parcel-pricing-service container_name: pricing-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5008:80 @@ -50,6 +60,8 @@ customers-service: image: adrianvsaint/swift-parcel-customers-service container_name: customers-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5002:80 @@ -59,6 +71,8 @@ orders-service: image: adrianvsaint/swift-parcel-orders-service container_name: orders-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5006:80 @@ -68,6 +82,8 @@ lecturer-api-service: image: adrianvsaint/swift-parcel-external-api-lecturer-service container_name: lecturer-api-service + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped ports: - 5004:80 @@ -77,6 +93,8 @@ api-gateway: image: adrianvsaint/swift-parcel-apigateway-service container_name: api-gateway + environment: + - ASPNETCORE_ENVIRONMENT=Production restart: unless-stopped environment: - NTRADA_CONFIG=ntrada.yml