From c14d2524536098012c330dc97df23fe226c8019e Mon Sep 17 00:00:00 2001 From: reggaeguitar Date: Thu, 18 Apr 2024 18:50:01 -0600 Subject: [PATCH] Upgrading to .net 8 --- ApiGateway/ApiGateway.csproj | 22 ++++++------- ApiGateway/Dockerfile | 6 ++-- BlazorServerWebUI/BlazorServerWebUI.csproj | 20 ++++++------ BlazorServerWebUI/Dockerfile | 6 ++-- CustomerWebApi/CustomerWebApi.csproj | 38 +++++++++++----------- CustomerWebApi/Dockerfile | 6 ++-- CustomerWebApi/Program.cs | 2 +- OrderWebApi/Dockerfile | 6 ++-- OrderWebApi/OrderWebApi.csproj | 22 ++++++------- ProductWebApi/Dockerfile | 6 ++-- ProductWebApi/ProductWebApi.csproj | 24 +++++++------- docker-compose.yml | 14 +++++--- 12 files changed, 89 insertions(+), 83 deletions(-) diff --git a/ApiGateway/ApiGateway.csproj b/ApiGateway/ApiGateway.csproj index 9d2a6b5..a37718e 100644 --- a/ApiGateway/ApiGateway.csproj +++ b/ApiGateway/ApiGateway.csproj @@ -1,16 +1,16 @@  - - net6.0 - enable - enable - Linux - ..\docker-compose.dcproj - + + net8.0 + enable + enable + Linux + ..\docker-compose.dcproj + - - - - + + + + diff --git a/ApiGateway/Dockerfile b/ApiGateway/Dockerfile index 9cdb004..a6b6366 100644 --- a/ApiGateway/Dockerfile +++ b/ApiGateway/Dockerfile @@ -1,10 +1,10 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app -EXPOSE 80 +EXPOSE 8080 -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["ApiGateway/ApiGateway.csproj", "ApiGateway/"] RUN dotnet restore "ApiGateway/ApiGateway.csproj" diff --git a/BlazorServerWebUI/BlazorServerWebUI.csproj b/BlazorServerWebUI/BlazorServerWebUI.csproj index 555976e..bc4f594 100644 --- a/BlazorServerWebUI/BlazorServerWebUI.csproj +++ b/BlazorServerWebUI/BlazorServerWebUI.csproj @@ -1,15 +1,15 @@ - - net6.0 - enable - enable - Linux - ..\docker-compose.dcproj - + + net8.0 + enable + enable + Linux + ..\docker-compose.dcproj + - - - + + + diff --git a/BlazorServerWebUI/Dockerfile b/BlazorServerWebUI/Dockerfile index 3178bf0..826d67a 100644 --- a/BlazorServerWebUI/Dockerfile +++ b/BlazorServerWebUI/Dockerfile @@ -1,10 +1,10 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app -EXPOSE 80 +EXPOSE 8080 -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["BlazorServerWebUI/BlazorServerWebUI.csproj", "BlazorServerWebUI/"] RUN dotnet restore "BlazorServerWebUI/BlazorServerWebUI.csproj" diff --git a/CustomerWebApi/CustomerWebApi.csproj b/CustomerWebApi/CustomerWebApi.csproj index 35726a7..05b879d 100644 --- a/CustomerWebApi/CustomerWebApi.csproj +++ b/CustomerWebApi/CustomerWebApi.csproj @@ -1,24 +1,24 @@ - - net6.0 - enable - enable - ..\docker-compose.dcproj - Linux - + + net8.0 + enable + enable + ..\docker-compose.dcproj + Linux + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/CustomerWebApi/Dockerfile b/CustomerWebApi/Dockerfile index b240e46..c3b3757 100644 --- a/CustomerWebApi/Dockerfile +++ b/CustomerWebApi/Dockerfile @@ -1,10 +1,10 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app -EXPOSE 80 +EXPOSE 8080 -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["CustomerWebApi/CustomerWebApi.csproj", "CustomerWebApi/"] RUN dotnet restore "CustomerWebApi/CustomerWebApi.csproj" diff --git a/CustomerWebApi/Program.cs b/CustomerWebApi/Program.cs index 7bd47fd..fcd9373 100644 --- a/CustomerWebApi/Program.cs +++ b/CustomerWebApi/Program.cs @@ -11,7 +11,7 @@ var dbHost = Environment.GetEnvironmentVariable("DB_HOST"); var dbName = Environment.GetEnvironmentVariable("DB_NAME"); var dbPassword = Environment.GetEnvironmentVariable("DB_SA_PASSWORD"); -var connectionString = $"Data Source={dbHost};Initial Catalog={dbName};User ID=sa;Password={dbPassword}"; +var connectionString = $"Data Source={dbHost};Initial Catalog={dbName};User ID=sa;Password={dbPassword};Encrypt=false"; builder.Services.AddDbContext(opt => opt.UseSqlServer(connectionString)); /* ===================================== */ diff --git a/OrderWebApi/Dockerfile b/OrderWebApi/Dockerfile index 50ff935..304ddde 100644 --- a/OrderWebApi/Dockerfile +++ b/OrderWebApi/Dockerfile @@ -1,10 +1,10 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app -EXPOSE 80 +EXPOSE 8080 -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["OrderWebApi/OrderWebApi.csproj", "OrderWebApi/"] RUN dotnet restore "OrderWebApi/OrderWebApi.csproj" diff --git a/OrderWebApi/OrderWebApi.csproj b/OrderWebApi/OrderWebApi.csproj index 4578692..66e8722 100644 --- a/OrderWebApi/OrderWebApi.csproj +++ b/OrderWebApi/OrderWebApi.csproj @@ -1,16 +1,16 @@  - - net6.0 - enable - enable - Linux - ..\docker-compose.dcproj - + + net8.0 + enable + enable + Linux + ..\docker-compose.dcproj + - - - - + + + + diff --git a/ProductWebApi/Dockerfile b/ProductWebApi/Dockerfile index 047eea7..751c4f8 100644 --- a/ProductWebApi/Dockerfile +++ b/ProductWebApi/Dockerfile @@ -1,10 +1,10 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app -EXPOSE 80 +EXPOSE 8080 -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["ProductWebApi/ProductWebApi.csproj", "ProductWebApi/"] RUN dotnet restore "ProductWebApi/ProductWebApi.csproj" diff --git a/ProductWebApi/ProductWebApi.csproj b/ProductWebApi/ProductWebApi.csproj index 3100ef9..10bb4e5 100644 --- a/ProductWebApi/ProductWebApi.csproj +++ b/ProductWebApi/ProductWebApi.csproj @@ -1,17 +1,17 @@ - - net6.0 - enable - enable - Linux - ..\DemoMicroserviceSolution - ..\docker-compose.dcproj - + + net8.0 + enable + enable + Linux + ..\DemoMicroserviceSolution + ..\docker-compose.dcproj + - - - - + + + + diff --git a/docker-compose.yml b/docker-compose.yml index 5e087f3..f16cb53 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: environment: - ACCEPT_EULA=Y - SA_PASSWORD=password@12345# + - ASPNETCORE_HTTP_PORTS=80 networks: - backend ports: @@ -28,12 +29,13 @@ services: - DB_HOST=customerdb - DB_NAME=dms_customer - DB_SA_PASSWORD=password@12345# - + - ASPNETCORE_HTTP_PORTS=80 productdb: container_name: product-db image: mysql:8.0.29-oracle environment: - MYSQL_ROOT_PASSWORD=password@12345# + - ASPNETCORE_HTTP_PORTS=80 ports: - 18003:3306 networks: @@ -51,6 +53,7 @@ services: - DB_HOST=productdb - DB_NAME=dms_product - DB_ROOT_PASSWORD=password@12345# + - ASPNETCORE_HTTP_PORTS=80 orderdb: container_name: order-db @@ -71,6 +74,7 @@ services: environment: - DB_HOST=orderdb - DB_NAME=dms_order + - ASPNETCORE_HTTP_PORTS=80 apigateway: container_name: api-gateway @@ -79,10 +83,12 @@ services: context: . dockerfile: ApiGateway/Dockerfile ports: - - 8001:80 + - 8001:8080 networks: - backend - frontend + environment: + - ASPNETCORE_HTTP_PORTS=80 blazorserverwebui: container_name: blazor-web-ui @@ -91,6 +97,6 @@ services: context: . dockerfile: BlazorServerWebUI/Dockerfile ports: - - 8002:80 + - 8002:8080 networks: - - frontend \ No newline at end of file + - frontend