From 4a2433290bb04fa3c9adb7857807ee1e1f74a976 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Fri, 15 Dec 2023 18:39:20 +0700 Subject: [PATCH] (#204) Upgrade .Net 8 --- .../workflows/.net-build-microservices.yml | 22 ++-- .../ClassifiedAds.Application.csproj | 6 +- .../ClassifiedAds.CrossCuttingConcerns.csproj | 4 +- .../ClassifiedAds.Domain.csproj | 6 +- .../ClassifiedAds.Infrastructure.csproj | 100 +++++++++--------- .../Logging/LoggingExtensions.cs | 2 - .../OpenTelemetry/OpenTelemetryExtensions.cs | 13 +-- .../OpenTelemetry/OpenTelemetryOptions.cs | 11 -- .../ClassifiedAds.Gateways.GraphQL.csproj | 2 +- .../ClassifiedAds.Gateways.WebAPI.csproj | 8 +- .../ClassifiedAds.Gateways.WebAPI/Dockerfile | 4 +- src/Microservices/README.md | 2 +- ...ClassifiedAds.Services.AuditLog.Api.csproj | 8 +- .../Dockerfile | 4 +- .../appsettings.json | 2 +- ...lassifiedAds.Services.AuditLog.Grpc.csproj | 6 +- .../Dockerfile | 4 +- .../ClassifiedAds.Services.AuditLog.csproj | 12 +-- ...ifiedAds.Services.Configuration.Api.csproj | 18 ++-- .../Dockerfile | 4 +- ...ClassifiedAds.Services.Identity.Api.csproj | 6 +- .../Dockerfile | 4 +- ...lassifiedAds.Services.Identity.Grpc.csproj | 4 +- .../Dockerfile | 4 +- ....Services.Identity.IntegrationTests.csproj | 12 +-- .../ClassifiedAds.Services.Identity.csproj | 16 +-- ...sifiedAds.Services.Notification.Api.csproj | 6 +- .../Dockerfile | 4 +- ...ds.Services.Notification.Background.csproj | 6 +- .../Dockerfile | 4 +- ...ifiedAds.Services.Notification.Grpc.csproj | 4 +- .../Dockerfile | 4 +- ...ClassifiedAds.Services.Notification.csproj | 10 +- .../ClassifiedAds.Services.Product.Api.csproj | 22 ++-- .../Dockerfile | 4 +- .../appsettings.json | 2 +- .../ClassifiedAds.Services.Storage.Api.csproj | 16 +-- .../Dockerfile | 4 +- .../appsettings.json | 2 +- src/Microservices/docker-compose.yml | 26 ++--- src/ModularMonolith/docker-compose.yml | 2 +- 41 files changed, 186 insertions(+), 214 deletions(-) diff --git a/.github/workflows/.net-build-microservices.yml b/.github/workflows/.net-build-microservices.yml index dd0172731..414ad7492 100644 --- a/.github/workflows/.net-build-microservices.yml +++ b/.github/workflows/.net-build-microservices.yml @@ -22,7 +22,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.101 + dotnet-version: 8.0.100 - name: Build run: dotnet build --configuration Release @@ -61,58 +61,58 @@ jobs: uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.AuditLog.Api - path: src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/bin/Release/net7.0/publish + path: src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Services.AuditLog.Grpc uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.AuditLog.Grpc - path: src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/bin/Release/net7.0/publish + path: src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Services.Identity.Api uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.Identity.Api - path: src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/bin/Release/net7.0/publish + path: src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Services.Identity.Grpc uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.Identity.Grpc - path: src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/bin/Release/net7.0/publish + path: src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Services.Notification.Api uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.Notification.Api - path: src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/bin/Release/net7.0/publish + path: src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Services.Notification.Background uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.Notification.Background - path: src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/bin/Release/net7.0/publish + path: src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Services.Notification.Grpc uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.Notification.Grpc - path: src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/bin/Release/net7.0/publish + path: src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Services.Product.Api uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.Product.Api - path: src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/bin/Release/net7.0/publish + path: src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Services.Storage.Api uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Services.Storage.Api - path: src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/bin/Release/net7.0/publish + path: src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/bin/Release/net8.0/publish - name: Upload ClassifiedAds.Gateways.WebAPI uses: actions/upload-artifact@v1.0.0 with: name: ClassifiedAds.Gateways.WebAPI - path: src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/bin/Release/net7.0/publish + path: src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/bin/Release/net8.0/publish diff --git a/src/Microservices/Common/ClassifiedAds.Application/ClassifiedAds.Application.csproj b/src/Microservices/Common/ClassifiedAds.Application/ClassifiedAds.Application.csproj index 3778219be..a4db53708 100644 --- a/src/Microservices/Common/ClassifiedAds.Application/ClassifiedAds.Application.csproj +++ b/src/Microservices/Common/ClassifiedAds.Application/ClassifiedAds.Application.csproj @@ -1,12 +1,12 @@ - net7.0 + net8.0 - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Common/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj b/src/Microservices/Common/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj index c92455636..881ce0e4c 100644 --- a/src/Microservices/Common/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj +++ b/src/Microservices/Common/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 ClassifiedAds.CrossCuttingConcerns @@ -10,7 +10,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Common/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj b/src/Microservices/Common/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj index c0357af71..03c316641 100644 --- a/src/Microservices/Common/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj +++ b/src/Microservices/Common/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj @@ -1,18 +1,18 @@  - net7.0 + net8.0 - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Common/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj b/src/Microservices/Common/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj index 81bdf585d..60b972cf6 100644 --- a/src/Microservices/Common/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj +++ b/src/Microservices/Common/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj @@ -1,74 +1,70 @@  - net7.0 + net8.0 ClassifiedAds.Infrastructure - + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + - - - + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/Microservices/Common/ClassifiedAds.Infrastructure/Logging/LoggingExtensions.cs b/src/Microservices/Common/ClassifiedAds.Infrastructure/Logging/LoggingExtensions.cs index c59c2176f..50fe9e30c 100644 --- a/src/Microservices/Common/ClassifiedAds.Infrastructure/Logging/LoggingExtensions.cs +++ b/src/Microservices/Common/ClassifiedAds.Infrastructure/Logging/LoggingExtensions.cs @@ -32,7 +32,6 @@ private static void UseClassifiedAdsLogger(this IWebHostEnvironment env, Logging loggerConfiguration = loggerConfiguration .MinimumLevel.Debug() .Enrich.FromLogContext() - .Enrich.With() .Enrich.WithMachineName() .Enrich.WithEnvironmentUserName() .Enrich.WithProperty("ProcessId", Environment.ProcessId) @@ -249,7 +248,6 @@ private static void UseClassifiedAdsLogger(this IHostEnvironment env, LoggingOpt loggerConfiguration = loggerConfiguration .MinimumLevel.Debug() .Enrich.FromLogContext() - .Enrich.With() .Enrich.WithMachineName() .Enrich.WithEnvironmentUserName() .Enrich.WithProperty("ProcessId", Environment.ProcessId) diff --git a/src/Microservices/Common/ClassifiedAds.Infrastructure/Monitoring/OpenTelemetry/OpenTelemetryExtensions.cs b/src/Microservices/Common/ClassifiedAds.Infrastructure/Monitoring/OpenTelemetry/OpenTelemetryExtensions.cs index 008bb7121..6fd2960e0 100644 --- a/src/Microservices/Common/ClassifiedAds.Infrastructure/Monitoring/OpenTelemetry/OpenTelemetryExtensions.cs +++ b/src/Microservices/Common/ClassifiedAds.Infrastructure/Monitoring/OpenTelemetry/OpenTelemetryExtensions.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using OpenTelemetry; using OpenTelemetry.Metrics; using OpenTelemetry.Resources; using OpenTelemetry.Trace; @@ -35,15 +34,6 @@ public static IServiceCollection AddClassifiedAdsOpenTelemetry(this IServiceColl .AddEntityFrameworkCoreInstrumentation() .AddHttpClientInstrumentation(); - if (options?.Jaeger?.IsEnabled ?? false) - { - builder.AddJaegerExporter(jaegerOptions => - { - jaegerOptions.AgentHost = options.Jaeger.AgentHost; - jaegerOptions.AgentPort = options.Jaeger.AgentPort; - }); - } - if (options?.Zipkin?.IsEnabled ?? false) { builder.AddZipkinExporter(zipkinOptions => @@ -75,8 +65,7 @@ public static IServiceCollection AddClassifiedAdsOpenTelemetry(this IServiceColl otlpOptions.Endpoint = new Uri(options.Otlp.Endpoint); }); } - }) - .StartWithHost(); + }); return services; } diff --git a/src/Microservices/Common/ClassifiedAds.Infrastructure/Monitoring/OpenTelemetry/OpenTelemetryOptions.cs b/src/Microservices/Common/ClassifiedAds.Infrastructure/Monitoring/OpenTelemetry/OpenTelemetryOptions.cs index 47ea4889e..27ee0c97b 100644 --- a/src/Microservices/Common/ClassifiedAds.Infrastructure/Monitoring/OpenTelemetry/OpenTelemetryOptions.cs +++ b/src/Microservices/Common/ClassifiedAds.Infrastructure/Monitoring/OpenTelemetry/OpenTelemetryOptions.cs @@ -8,8 +8,6 @@ public class OpenTelemetryOptions public ZipkinOptions Zipkin { get; set; } - public JaegerOptions Jaeger { get; set; } - public OtlpOptions Otlp { get; set; } } @@ -20,15 +18,6 @@ public class ZipkinOptions public string Endpoint { get; set; } } -public class JaegerOptions -{ - public bool IsEnabled { get; set; } - - public string AgentHost { get; set; } - - public int AgentPort { get; set; } -} - public class OtlpOptions { public bool IsEnabled { get; set; } diff --git a/src/Microservices/Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL.csproj b/src/Microservices/Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL.csproj index 75f5c76e8..a866af01f 100644 --- a/src/Microservices/Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL.csproj +++ b/src/Microservices/Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj b/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj index 492ac21af..64cffad1b 100644 --- a/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj +++ b/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj @@ -1,14 +1,14 @@  - net7.0 + net8.0 4a8b7447-cb04-4631-8420-8ac41700e230 - - - + + + diff --git a/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile b/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile index 1d12ffe2b..871f116d4 100644 --- a/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile +++ b/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -17,7 +17,7 @@ COPY . ./ RUN dotnet publish ./Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/README.md b/src/Microservices/README.md index d3ca670f3..9d11a9e78 100644 --- a/src/Microservices/README.md +++ b/src/Microservices/README.md @@ -142,7 +142,7 @@ - Build ``` - docker-compose build + docker compose build ``` - Tag diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj index 8b7136915..7a90ae94b 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj @@ -1,13 +1,13 @@  - net7.0 + net8.0 c0d90214-b332-43c7-baa7-9a7ebf96ae71 - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/Dockerfile b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/Dockerfile index ea3dd5771..ed53ac37c 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/Dockerfile +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/appsettings.json b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/appsettings.json index 0eea14a68..b00a67cfa 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/appsettings.json +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/appsettings.json @@ -26,7 +26,7 @@ }, "AllowedHosts": "*", "MessageBroker": { - "Provider": "Fake", + "Provider": "RabbitMQ", "RabbitMQ": { "HostName": "localhost", "UserName": "guest", diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/ClassifiedAds.Services.AuditLog.Grpc.csproj b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/ClassifiedAds.Services.AuditLog.Grpc.csproj index 1b1d7326c..1c8a5e3bf 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/ClassifiedAds.Services.AuditLog.Grpc.csproj +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/ClassifiedAds.Services.AuditLog.Grpc.csproj @@ -1,16 +1,16 @@  - net7.0 + net8.0 c0d90214-b332-43c7-baa7-9a7ebf96ae71 - + - + diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Dockerfile b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Dockerfile index 2850631e2..2bdb46849 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Dockerfile +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/ClassifiedAds.Services.AuditLog.Grpc.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog/ClassifiedAds.Services.AuditLog.csproj b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog/ClassifiedAds.Services.AuditLog.csproj index 6ae7096b0..7dcaadba6 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog/ClassifiedAds.Services.AuditLog.csproj +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog/ClassifiedAds.Services.AuditLog.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable enable @@ -9,14 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj index c205e6711..91f10943b 100644 --- a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj +++ b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj @@ -1,27 +1,27 @@  - net7.0 + net8.0 - - + + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/Dockerfile b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/Dockerfile index 73499a068..5453e26e6 100644 --- a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/Dockerfile +++ b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -17,7 +17,7 @@ COPY . ./ RUN dotnet publish ./Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj index 217cb3a1e..258998a63 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj @@ -1,13 +1,13 @@  - net7.0 + net8.0 37e169d5-ecb0-4b12-acf3-07a624b9c6c9 - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/Dockerfile b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/Dockerfile index d4b6727c6..b88deaf8d 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/Dockerfile +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/ClassifiedAds.Services.Identity.Grpc.csproj b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/ClassifiedAds.Services.Identity.Grpc.csproj index 5475c03e5..456bc016a 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/ClassifiedAds.Services.Identity.Grpc.csproj +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/ClassifiedAds.Services.Identity.Grpc.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 @@ -9,7 +9,7 @@ - + diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Dockerfile b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Dockerfile index 48f5fa3e9..85ec6a5a3 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Dockerfile +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Identity/ClassifiedAds.Services.Identity.Grpc/ClassifiedAds.Services.Identity.Grpc.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.IntegrationTests/ClassifiedAds.Services.Identity.IntegrationTests.csproj b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.IntegrationTests/ClassifiedAds.Services.Identity.IntegrationTests.csproj index 688e14ec0..779d8c226 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.IntegrationTests/ClassifiedAds.Services.Identity.IntegrationTests.csproj +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.IntegrationTests/ClassifiedAds.Services.Identity.IntegrationTests.csproj @@ -1,23 +1,23 @@  - net7.0 + net8.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity/ClassifiedAds.Services.Identity.csproj b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity/ClassifiedAds.Services.Identity.csproj index af1a096fe..4ffe0def8 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity/ClassifiedAds.Services.Identity.csproj +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity/ClassifiedAds.Services.Identity.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable @@ -9,16 +9,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj index 5eadd4680..ce98561f0 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj @@ -1,12 +1,12 @@  - net7.0 + net8.0 3bb18abd-09c2-44f2-900e-28cc944866e1 - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -14,7 +14,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/Dockerfile b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/Dockerfile index d842430b3..605118cb3 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/Dockerfile +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj index 5aa49dfa3..f2247cc44 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj @@ -1,13 +1,13 @@  - net7.0 + net8.0 3bb18abd-09c2-44f2-900e-28cc944866e1 - - + + diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/Dockerfile b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/Dockerfile index 6101837ce..78b225fb9 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/Dockerfile +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/ClassifiedAds.Services.Notification.Grpc.csproj b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/ClassifiedAds.Services.Notification.Grpc.csproj index 4e81d228b..0dfc99af0 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/ClassifiedAds.Services.Notification.Grpc.csproj +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/ClassifiedAds.Services.Notification.Grpc.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 3bb18abd-09c2-44f2-900e-28cc944866e1 @@ -11,7 +11,7 @@ - + diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Dockerfile b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Dockerfile index b7fdd55cf..a39302196 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Dockerfile +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Notification/ClassifiedAds.Services.Notification.Grpc/ClassifiedAds.Services.Notification.Grpc.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification/ClassifiedAds.Services.Notification.csproj b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification/ClassifiedAds.Services.Notification.csproj index d42257ad9..19f1f77f0 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification/ClassifiedAds.Services.Notification.csproj +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification/ClassifiedAds.Services.Notification.csproj @@ -1,15 +1,15 @@  - net7.0 + net8.0 enable - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj index 66adbcee3..950beb313 100644 --- a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj +++ b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj @@ -1,34 +1,34 @@  - net7.0 + net8.0 0de8f61d-276a-4df2-a419-89d3cbb127ff - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/Dockerfile b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/Dockerfile index a11a696c9..aff3daf0a 100644 --- a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/Dockerfile +++ b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -17,7 +17,7 @@ COPY . ./ RUN dotnet publish ./Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/appsettings.json b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/appsettings.json index 3fdad8c37..81458409d 100644 --- a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/appsettings.json +++ b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/appsettings.json @@ -26,7 +26,7 @@ }, "AllowedHosts": "*", "MessageBroker": { - "Provider": "Fake", + "Provider": "RabbitMQ", "RabbitMQ": { "HostName": "localhost", "UserName": "guest", diff --git a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj index ba9102d9f..eb7cec13a 100644 --- a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj +++ b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj @@ -1,30 +1,30 @@  - net7.0 + net8.0 f2e298d9-f756-4769-92a2-d920b7e1a422 - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/Dockerfile b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/Dockerfile index cc92833ba..0223dab7c 100644 --- a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/Dockerfile +++ b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -17,7 +17,7 @@ COPY . ./ RUN dotnet publish ./Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/appsettings.json b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/appsettings.json index 793faa141..7b7142a80 100644 --- a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/appsettings.json +++ b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/appsettings.json @@ -33,7 +33,7 @@ } }, "MessageBroker": { - "Provider": "Fake", + "Provider": "RabbitMQ", "RabbitMQ": { "HostName": "localhost", "UserName": "guest", diff --git a/src/Microservices/docker-compose.yml b/src/Microservices/docker-compose.yml index 9bc3d902a..2a979e3c2 100644 --- a/src/Microservices/docker-compose.yml +++ b/src/Microservices/docker-compose.yml @@ -209,22 +209,22 @@ services: context: . dockerfile: ./Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile ports: - - "9002:80" + - "9002:8080" depends_on: - db environment: ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT} ProxyProvider: "Ocelot" Ocelot__DefaultDownstreamScheme: "http" - Ocelot__Routes__Products__Downstream: "http://product-api" - Ocelot__Routes__Files__Downstream: "http://storage-api" - Ocelot__Routes__AuditLogs__Downstream: "http://auditlog-api" - Ocelot__Routes__Users__Downstream: "http://identity-api" - Ocelot__Routes__Configurations__Downstream: "http://configuration-api" - Ocelot__Routes__Hubs__Downstream: "ws://notification-api" - Yarp__Clusters__Products__Destinations__destination1__Address: "http://product-api" - Yarp__Clusters__Files__Destinations__destination1__Address: "http://storage-api" - Yarp__Clusters__AuditLogs__Destinations__destination1__Address: "http://auditlog-api" - Yarp__Clusters__Users__Destinations__destination1__Address: "http://identity-api" - Yarp__Clusters__Configurations__Destinations__destination1__Address: "http://configuration-api" - Yarp__Clusters__Hubs__Destinations__destination1__Address: "http://notification-api" + Ocelot__Routes__Products__Downstream: "http://product-api:8080" + Ocelot__Routes__Files__Downstream: "http://storage-api:8080" + Ocelot__Routes__AuditLogs__Downstream: "http://auditlog-api:8080" + Ocelot__Routes__Users__Downstream: "http://identity-api:8080" + Ocelot__Routes__Configurations__Downstream: "http://configuration-api:8080" + Ocelot__Routes__Hubs__Downstream: "ws://notification-api:8080" + Yarp__Clusters__Products__Destinations__destination1__Address: "http://product-api:8080" + Yarp__Clusters__Files__Destinations__destination1__Address: "http://storage-api:8080" + Yarp__Clusters__AuditLogs__Destinations__destination1__Address: "http://auditlog-api:8080" + Yarp__Clusters__Users__Destinations__destination1__Address: "http://identity-api:8080" + Yarp__Clusters__Configurations__Destinations__destination1__Address: "http://configuration-api:8080" + Yarp__Clusters__Hubs__Destinations__destination1__Address: "http://notification-api:8080" diff --git a/src/ModularMonolith/docker-compose.yml b/src/ModularMonolith/docker-compose.yml index 91378e720..4854d37a6 100644 --- a/src/ModularMonolith/docker-compose.yml +++ b/src/ModularMonolith/docker-compose.yml @@ -41,7 +41,7 @@ services: context: ../IdentityServer/IdentityServer4 dockerfile: ./ClassifiedAds.IdentityServer/Dockerfile ports: - - "9000:8080" + - "9000:80" depends_on: - db - migrator