From b1e16ee4beb9bd418a14cad2dccd2f185b887e12 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 13:22:53 +0300 Subject: [PATCH] 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