From b1e16ee4beb9bd418a14cad2dccd2f185b887e12 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 13:22:53 +0300 Subject: [PATCH 01/12] Updated to local dockerfiles and image build script --- apps/angular/{Dockerfile => Dockerfile.local} | 0 .../{Dockerfile => Dockerfile.local} | 0 .../{Dockerfile => Dockerfile.local} | 0 build/build-images-locally.ps1 | 69 +++++++++++++++++++ .../{Dockerfile => Dockerfile.local} | 0 .../{Dockerfile => Dockerfile.local} | 0 .../{Dockerfile => Dockerfile.local} | 0 .../Dockerfile.local | 4 ++ .../Dockerfile.local | 4 ++ .../{Dockerfile => Dockerfile.local} | 0 .../Dockerfile.local | 4 ++ .../Dockerfile.local | 4 ++ .../Dockerfile.local | 4 ++ 13 files changed, 89 insertions(+) rename apps/angular/{Dockerfile => Dockerfile.local} (100%) rename apps/auth-server/src/EShopOnAbp.AuthServer/{Dockerfile => Dockerfile.local} (100%) rename apps/public-web/src/EShopOnAbp.PublicWeb/{Dockerfile => Dockerfile.local} (100%) create mode 100644 build/build-images-locally.ps1 rename gateways/web-public/src/EShopOnAbp.WebPublicGateway/{Dockerfile => Dockerfile.local} (100%) rename gateways/web/src/EShopOnAbp.WebGateway/{Dockerfile => Dockerfile.local} (100%) rename services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/{Dockerfile => Dockerfile.local} (100%) create mode 100644 services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile.local create mode 100644 services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local rename services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/{Dockerfile => Dockerfile.local} (100%) create mode 100644 services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile.local create mode 100644 services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile.local create mode 100644 services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile.local diff --git a/apps/angular/Dockerfile b/apps/angular/Dockerfile.local similarity index 100% rename from apps/angular/Dockerfile rename to apps/angular/Dockerfile.local diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile.local similarity index 100% rename from apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile rename to apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile.local diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile b/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile.local similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile rename to apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile.local diff --git a/build/build-images-locally.ps1 b/build/build-images-locally.ps1 new file mode 100644 index 00000000..97809583 --- /dev/null +++ b/build/build-images-locally.ps1 @@ -0,0 +1,69 @@ +param ($version='latest') + +$currentFolder = $PSScriptRoot +$slnFolder = Join-Path $currentFolder "../" +$webAppFolder = Join-Path $slnFolder "apps/angular" +$authserverFolder = Join-Path $slnFolder "apps/auth-server/src/EShopOnAbp.AuthServer" +$publicWebFolder = Join-Path $slnFolder "apps/public-web/src/EShopOnAbp.PublicWeb" + +$webGatewayFolder = Join-Path $slnFolder "gateways/web/src/EShopOnAbp.WebGateway" +$webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" +$internalGatewayFolder = Join-Path $slnFolder "gateways/internal/src/EShopOnAbp.InternalGateway" + +$identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" +$administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +$saasServiceFolder = Join-Path $slnFolder "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host" + +### Angular WEB App(WWW) +Write-Host "*** BUILDING WEB (WWW) ****************" -ForegroundColor Green +Set-Location $webAppFolder +yarn +# ng build --prod +npm run build:prod +docker build -t eshoponabp/app-web:$version . + +### AUTH-SERVER +Write-Host "*** BUILDING AUTH-SERVER ****************" -ForegroundColor Green +Set-Location $authserverFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/app-authserver:$version . + +### PUBLIC-WEB +Write-Host "*** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green +Set-Location $publicWebFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/app-publicweb:$version . + +### WEB-GATEWAY +Write-Host "*** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green +Set-Location $webGatewayFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/gateway-web:$version . + +### PUBLICWEB-GATEWAY +Write-Host "*** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green +Set-Location $webPublicGatewayFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/gateway-web-public:$version . + +### IDENTITY-SERVICE +Write-Host "*** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green +Set-Location $identityServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-identity:$version . + +### ADMINISTRATION-SERVICE +Write-Host "*** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green +Set-Location $administrationServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-administration:$version . + +### SAAS-SERVICE +Write-Host "*** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green +Set-Location $saasServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-saas:$version . + +### ALL COMPLETED +Write-Host "ALL COMPLETED" -ForegroundColor Green +Set-Location $currentFolder \ No newline at end of file diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile.local similarity index 100% rename from gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile rename to gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile.local diff --git a/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile b/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile.local similarity index 100% rename from gateways/web/src/EShopOnAbp.WebGateway/Dockerfile rename to gateways/web/src/EShopOnAbp.WebGateway/Dockerfile.local diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile.local similarity index 100% rename from services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile rename to services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile.local diff --git a/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile.local b/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile.local new file mode 100644 index 00000000..c9ac1070 --- /dev/null +++ b/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile.local @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.BasketService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local new file mode 100644 index 00000000..28dcb67f --- /dev/null +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.CatalogService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile.local similarity index 100% rename from services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile rename to services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile.local diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile.local b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile.local new file mode 100644 index 00000000..a4e919b7 --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile.local @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.OrderingService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile.local b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile.local new file mode 100644 index 00000000..07db2a8c --- /dev/null +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile.local @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.PaymentService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile.local b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile.local new file mode 100644 index 00000000..505246d8 --- /dev/null +++ b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile.local @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.SaasService.HttpApi.Host.dll"] \ No newline at end of file From 94ee55b7f3dee1b5ec99727904f88187a97c6679 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 17:53:40 +0300 Subject: [PATCH 02/12] Removed internal gateway from image build script --- build/build-images-locally.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/build-images-locally.ps1 b/build/build-images-locally.ps1 index 97809583..cf85bc3f 100644 --- a/build/build-images-locally.ps1 +++ b/build/build-images-locally.ps1 @@ -8,7 +8,6 @@ $publicWebFolder = Join-Path $slnFolder "apps/public-web/src/EShopOnAbp.PublicWe $webGatewayFolder = Join-Path $slnFolder "gateways/web/src/EShopOnAbp.WebGateway" $webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" -$internalGatewayFolder = Join-Path $slnFolder "gateways/internal/src/EShopOnAbp.InternalGateway" $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" $administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" From 54b30964e1c84960118f918a7192e17f2161872f Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 17:54:01 +0300 Subject: [PATCH 03/12] Added nuget.config for reference --- NuGet.Config | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 NuGet.Config diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 00000000..f578cf96 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file From def9d5ae965caa25df3052ede1b0d35bdb49c3d1 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 17:56:22 +0300 Subject: [PATCH 04/12] set authserver project to default --- .../src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj b/apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj index 074096a4..80712c03 100644 --- a/apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj @@ -2,9 +2,6 @@ net6.0 - true - true - true From 00ee81e45a391b448d117e3ac72644c6ee6a0fc3 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 17:58:06 +0300 Subject: [PATCH 05/12] added application multistage dockerfiles --- .../src/EShopOnAbp.AuthServer/Dockerfile | 53 +++++++++++++++++++ .../src/EShopOnAbp.PublicWeb/Dockerfile | 53 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile create mode 100644 apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile new file mode 100644 index 00000000..1bbffe2c --- /dev/null +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile @@ -0,0 +1,53 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/apps/auth-server/src/EShopOnAbp.AuthServer" + +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.AuthServer.dll"] \ No newline at end of file diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile b/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile new file mode 100644 index 00000000..813b2f49 --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile @@ -0,0 +1,53 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/apps/public-web/src/EShopOnAbp.PublicWeb" + +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.PublicWeb.dll"] \ No newline at end of file From 50d4d1ce4773c70ab183523cfee5dda3604cde79 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 18:29:55 +0300 Subject: [PATCH 06/12] added microservice multistage dockerfiles --- .../Dockerfile | 52 +++++++++++++++++ .../Dockerfile | 52 +++++++++++++++++ .../Dockerfile | 56 +++++++++++++++++-- 3 files changed, 156 insertions(+), 4 deletions(-) create mode 100644 services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile create mode 100644 services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..d498afbf --- /dev/null +++ b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile @@ -0,0 +1,52 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.AdministrationService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..a2a86593 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile @@ -0,0 +1,52 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.IdentityService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile index 505246d8..eaf6cbd0 100644 --- a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile +++ b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile @@ -1,4 +1,52 @@ - FROM mcr.microsoft.com/dotnet/aspnet:6.0 - COPY bin/Release/net6.0/publish/ app/ - WORKDIR /app - ENTRYPOINT ["dotnet", "EShopOnAbp.SaasService.HttpApi.Host.dll"] \ No newline at end of file +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.SaasService.HttpApi.Host.dll"] \ No newline at end of file From b308f834761a95b9430ae66549bbd3c1cbfc34de Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 18:30:09 +0300 Subject: [PATCH 07/12] added gateway multistage dockerfiles --- .../EShopOnAbp.WebPublicGateway/Dockerfile | 52 +++++++++++++++++++ .../web/src/EShopOnAbp.WebGateway/Dockerfile | 52 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile create mode 100644 gateways/web/src/EShopOnAbp.WebGateway/Dockerfile diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile new file mode 100644 index 00000000..becc090b --- /dev/null +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile @@ -0,0 +1,52 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.WebPublicGateway.dll"] \ No newline at end of file diff --git a/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile b/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile new file mode 100644 index 00000000..d217b262 --- /dev/null +++ b/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile @@ -0,0 +1,52 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/EShopOnAbp.SaasService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.WebGateway.dll"] \ No newline at end of file From 2e495b87b35435aede96cff23c6e86babdcaa171 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 18:30:26 +0300 Subject: [PATCH 08/12] added build script --- build/build-images.ps1 | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 build/build-images.ps1 diff --git a/build/build-images.ps1 b/build/build-images.ps1 new file mode 100644 index 00000000..89117fb2 --- /dev/null +++ b/build/build-images.ps1 @@ -0,0 +1,64 @@ +param ($version='1.0') + +$currentFolder = $PSScriptRoot +$slnFolder = Join-Path $currentFolder "../" +$webAppFolder = Join-Path $slnFolder "apps/angular" +$authserverFolder = Join-Path $slnFolder "apps/auth-server/src/EShopOnAbp.AuthServer" +$publicWebFolder = Join-Path $slnFolder "apps/public-web/src/EShopOnAbp.PublicWeb" + +$webGatewayFolder = Join-Path $slnFolder "gateways/web/src/EShopOnAbp.WebGateway" +$webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" + +$identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" +$administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +$saasServiceFolder = Join-Path $slnFolder "services/saas/src/EShopOnAbp.SaasService.HttpApi.Host" + +Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow + +# ### Angular WEB App +# Write-Host "*** BUILDING ANGULAR WEB APPLICATION ***" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . + +### AUTH-SERVER +Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . + +### PUBLIC-WEB +Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . + +Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow + +### WEB-GATEWAY +Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . + +### PUBLICWEB-GATEWAY +Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green +Set-Location $webPublicGatewayFolder +docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . + +Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow + +### IDENTITY-SERVICE +Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . + +### ADMINISTRATION-SERVICE +Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . + +### SAAS-SERVICE +Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . + +### ALL COMPLETED +Write-Host "ALL COMPLETED" -ForegroundColor Green +Set-Location $currentFolder \ No newline at end of file From bbf934d67eb4808c49061eab3ab05624325d82ea Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 19:13:09 +0300 Subject: [PATCH 09/12] fixed gateway image build error --- build/build-images.ps1 | 44 +++++++++---------- .../EShopOnAbp.WebPublicGateway/Dockerfile | 2 +- .../web/src/EShopOnAbp.WebGateway/Dockerfile | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build/build-images.ps1 b/build/build-images.ps1 index 89117fb2..2fdb47e1 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -20,17 +20,17 @@ Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow # Set-Location $slnFolder # docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . -### AUTH-SERVER -Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . +# ### AUTH-SERVER +# Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . -### PUBLIC-WEB -Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . +# ### PUBLIC-WEB +# Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . -Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow +# Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow ### WEB-GATEWAY Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green @@ -39,25 +39,25 @@ docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$versio ### PUBLICWEB-GATEWAY Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green -Set-Location $webPublicGatewayFolder +Set-Location $slnFolder docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow -### IDENTITY-SERVICE -Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . +# ### IDENTITY-SERVICE +# Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . -### ADMINISTRATION-SERVICE -Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . +# ### ADMINISTRATION-SERVICE +# Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . -### SAAS-SERVICE -Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . +# ### SAAS-SERVICE +# Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . ### ALL COMPLETED Write-Host "ALL COMPLETED" -ForegroundColor Green diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile index becc090b..ea373981 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile @@ -39,7 +39,7 @@ COPY "NuGet.Config" "NuGet.Config" RUN dotnet restore "EShopOnAbp.sln" COPY . . -WORKDIR "/src/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway" +WORKDIR "/src/gateways/web-public/src/EShopOnAbp.WebPublicGateway" RUN dotnet publish -c Release -o /app # Should be used after .net6 is out of preview for better performance # RUN dotnet publish --no-restore -c Release -o /app diff --git a/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile b/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile index d217b262..9ad062f6 100644 --- a/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile +++ b/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile @@ -39,7 +39,7 @@ COPY "NuGet.Config" "NuGet.Config" RUN dotnet restore "EShopOnAbp.sln" COPY . . -WORKDIR "/src/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway" +WORKDIR "/src/gateways/web/src/EShopOnAbp.WebGateway" RUN dotnet publish -c Release -o /app # Should be used after .net6 is out of preview for better performance # RUN dotnet publish --no-restore -c Release -o /app From 5c20809c0d4bfe655400c2779b0b5a4d6185e7c8 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 19:15:13 +0300 Subject: [PATCH 10/12] uncommented build script --- build/build-images.ps1 | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/build/build-images.ps1 b/build/build-images.ps1 index 2fdb47e1..862a8fa4 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -20,17 +20,17 @@ Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow # Set-Location $slnFolder # docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . -# ### AUTH-SERVER -# Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . +### AUTH-SERVER +Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . -# ### PUBLIC-WEB -# Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . +### PUBLIC-WEB +Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . -# Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow +Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow ### WEB-GATEWAY Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green @@ -44,20 +44,20 @@ docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-p Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow -# ### IDENTITY-SERVICE -# Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . +### IDENTITY-SERVICE +Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . -# ### ADMINISTRATION-SERVICE -# Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . +### ADMINISTRATION-SERVICE +Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . -# ### SAAS-SERVICE -# Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . +### SAAS-SERVICE +Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . ### ALL COMPLETED Write-Host "ALL COMPLETED" -ForegroundColor Green From 1fcc2a7734f31b6f58e4e8d23dadf17bd38e202c Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 20:05:04 +0300 Subject: [PATCH 11/12] updated angular multistage docker image and script --- apps/angular/Dockerfile | 15 +++++++++ build/build-images.ps1 | 68 ++++++++++++++++++++--------------------- 2 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 apps/angular/Dockerfile diff --git a/apps/angular/Dockerfile b/apps/angular/Dockerfile new file mode 100644 index 00000000..837db661 --- /dev/null +++ b/apps/angular/Dockerfile @@ -0,0 +1,15 @@ +FROM node:14-alpine as build + +WORKDIR /app +COPY package*.json /app/ + +RUN npm install +COPY . /app +ARG configuration=production +RUN npm run ng build -- --output-path=dist/EShopOnAbp --configuration $configuration + +FROM nginx:alpine +COPY dynamic-env.json /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +COPY --from=build /app/dist/EShopOnAbp/ /usr/share/nginx/html diff --git a/build/build-images.ps1 b/build/build-images.ps1 index 862a8fa4..122bb2fe 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -15,49 +15,49 @@ $saasServiceFolder = Join-Path $slnFolder "services/saas/src/EShopOnAbp.SaasServ Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow -# ### Angular WEB App -# Write-Host "*** BUILDING ANGULAR WEB APPLICATION ***" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . +### Angular WEB App +Write-Host "*** BUILDING ANGULAR WEB APPLICATION ***" -ForegroundColor Green +Set-Location $webAppFolder +docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . -### AUTH-SERVER -Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . +# ### AUTH-SERVER +# Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . -### PUBLIC-WEB -Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . +# ### PUBLIC-WEB +# Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . -Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow +# Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow -### WEB-GATEWAY -Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . +# ### WEB-GATEWAY +# Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . -### PUBLICWEB-GATEWAY -Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . +# ### PUBLICWEB-GATEWAY +# Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . -Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow +# Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow -### IDENTITY-SERVICE -Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . +# ### IDENTITY-SERVICE +# Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . -### ADMINISTRATION-SERVICE -Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . +# ### ADMINISTRATION-SERVICE +# Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . -### SAAS-SERVICE -Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green -Set-Location $slnFolder -docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . +# ### SAAS-SERVICE +# Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green +# Set-Location $slnFolder +# docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . ### ALL COMPLETED Write-Host "ALL COMPLETED" -ForegroundColor Green From 100e256ff23ebc08b123b33a9d8f9448126e115e Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 20:16:07 +0300 Subject: [PATCH 12/12] uncommented test on build script --- build/build-images.ps1 | 60 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/build/build-images.ps1 b/build/build-images.ps1 index 122bb2fe..c85d615c 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -20,44 +20,44 @@ Write-Host "*** BUILDING ANGULAR WEB APPLICATION ***" -ForegroundColor Green Set-Location $webAppFolder docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . -# ### AUTH-SERVER -# Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . +### AUTH-SERVER +Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . -# ### PUBLIC-WEB -# Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . +### PUBLIC-WEB +Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . -# Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow +Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow -# ### WEB-GATEWAY -# Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . +### WEB-GATEWAY +Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . -# ### PUBLICWEB-GATEWAY -# Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . +### PUBLICWEB-GATEWAY +Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . -# Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow +Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow -# ### IDENTITY-SERVICE -# Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . +### IDENTITY-SERVICE +Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . -# ### ADMINISTRATION-SERVICE -# Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . +### ADMINISTRATION-SERVICE +Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . -# ### SAAS-SERVICE -# Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green -# Set-Location $slnFolder -# docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . +### SAAS-SERVICE +Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . ### ALL COMPLETED Write-Host "ALL COMPLETED" -ForegroundColor Green