Proper gRPC protocol

This commit is contained in:
2025-09-18 01:02:25 +08:00
parent 3d47b4e44e
commit f6f0703cb3
6 changed files with 167 additions and 64 deletions

View File

@@ -40,9 +40,11 @@ services:
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
HTTP_PORTS: "${RING_PORT}"
HTTPS_PORTS: "5001"
ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
services__pass__http__0: "http://pass:${PASS_PORT}"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire:18889"
services__pass__grpc__0: "https://pass:5001"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889"
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
OTEL_SERVICE_NAME: "ring"
volumes:
@@ -50,6 +52,7 @@ services:
- "./settings/ring.json:/app/appsettings.json"
expose:
- "${RING_PORT}"
- "5001"
networks:
- "aspire"
pass:
@@ -60,9 +63,11 @@ services:
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
HTTP_PORTS: "${PASS_PORT}"
HTTPS_PORTS: "5001"
ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
services__ring__http__0: "http://ring:${RING_PORT}"
services__ring__grpc__0: "https://ring:5001"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889"
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
OTEL_SERVICE_NAME: "pass"
@@ -71,6 +76,7 @@ services:
- "./settings/pass.json:/app/appsettings.json"
expose:
- "${PASS_PORT}"
- "5001"
networks:
- "aspire"
drive:
@@ -81,15 +87,19 @@ services:
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
HTTP_PORTS: "${DRIVE_PORT}"
HTTPS_PORTS: "5001"
ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
services__pass__http__0: "http://pass:${PASS_PORT}"
services__pass__grpc__0: "https://pass:5001"
services__ring__http__0: "http://ring:${RING_PORT}"
services__ring__grpc__0: "https://ring:5001"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889"
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
OTEL_SERVICE_NAME: "drive"
expose:
- "${DRIVE_PORT}"
- "5001"
volumes:
- "./settings/drive.json:/app/appsettings.json"
networks:
@@ -102,10 +112,13 @@ services:
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
HTTP_PORTS: "${SPHERE_PORT}"
HTTPS_PORTS: "5001"
ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
ConnectionStrings__queue: "nats://nats:${QUEUE_PASSWORD}@queue:4222"
services__pass__http__0: "http://pass:${PASS_PORT}"
services__pass__grpc__0: "https://pass:5001"
services__ring__http__0: "http://ring:${RING_PORT}"
services__ring__grpc__0: "https://ring:5001"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889"
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
OTEL_SERVICE_NAME: "sphere"
@@ -114,6 +127,7 @@ services:
- "./settings/sphere.json:/app/appsettings.json"
expose:
- "${SPHERE_PORT}"
- "5001"
networks:
- "aspire"
develop:
@@ -124,14 +138,18 @@ services:
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
HTTP_PORTS: "${DEVELOP_PORT}"
HTTPS_PORTS: "5001"
ConnectionStrings__cache: "cache:6379,password=${CACHE_PASSWORD}"
services__pass__http__0: "http://pass:${PASS_PORT}"
services__pass__grpc__0: "https://pass:5001"
services__ring__http__0: "http://ring:${RING_PORT}"
services__ring__grpc__0: "https://ring:5001"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889"
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
OTEL_SERVICE_NAME: "develop"
expose:
- "${DEVELOP_PORT}"
- "5001"
networks:
- "aspire"
gateway:
@@ -143,6 +161,7 @@ services:
environment:
ASPNETCORE_ENVIRONMENT: "Production"
services__ring__http__0: "http://ring:${RING_PORT}"
services__ring__grpc__0: "https://ring:5001"
REVERSEPROXY__ROUTES__route0__MATCH__PATH: "/ws"
REVERSEPROXY__ROUTES__route0__CLUSTERID: "cluster_ring"
REVERSEPROXY__ROUTES__route1__MATCH__PATH: "/ring/{**catch-all}"
@@ -177,9 +196,13 @@ services:
REVERSEPROXY__CLUSTERS__cluster_sphere__DESTINATIONS__destination1__ADDRESS: "http://_http.sphere"
REVERSEPROXY__CLUSTERS__cluster_develop__DESTINATIONS__destination1__ADDRESS: "http://_http.develop"
services__pass__http__0: "http://pass:${PASS_PORT}"
services__pass__grpc__0: "https://pass:5001"
services__drive__http__0: "http://drive:${DRIVE_PORT}"
services__drive__grpc__0: "https://drive:5001"
services__sphere__http__0: "http://sphere:${SPHERE_PORT}"
services__sphere__grpc__0: "https://sphere:5001"
services__develop__http__0: "http://develop:${DEVELOP_PORT}"
services__develop__grpc__0: "https://develop:5001"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889"
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
OTEL_SERVICE_NAME: "gateway"