From 57a236b1d8d7d5d74267af95d9d078f034888018 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 7 Oct 2021 14:07:28 +0300 Subject: [PATCH 1/4] added docker files --- apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile | 4 ++++ apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile | 4 ++++ gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile | 4 ++++ .../web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile | 4 ++++ gateways/web/src/EShopOnAbp.WebGateway/Dockerfile | 4 ++++ .../EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile | 4 ++++ .../src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile | 4 ++++ .../saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile | 4 ++++ 8 files changed, 32 insertions(+) create mode 100644 apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile create mode 100644 apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile create mode 100644 gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile create mode 100644 gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile create mode 100644 gateways/web/src/EShopOnAbp.WebGateway/Dockerfile create mode 100644 services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile create mode 100644 services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile create mode 100644 services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/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..fc794e5b --- /dev/null +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:5.0 + COPY bin/Release/net5.0/publish/ app/ + WORKDIR /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..5a1602ae --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:5.0 + COPY bin/Release/net5.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.PublicWeb.dll"] \ No newline at end of file diff --git a/gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile b/gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile new file mode 100644 index 00000000..51c96f66 --- /dev/null +++ b/gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:5.0 + COPY bin/Release/net5.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.InternalGateway.dll"] \ No newline at end of file diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile new file mode 100644 index 00000000..4fa3b189 --- /dev/null +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:5.0 + COPY bin/Release/net5.0/publish/ app/ + WORKDIR /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..896ad6fe --- /dev/null +++ b/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:5.0 + COPY bin/Release/net5.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.WebGateway.dll"] \ No newline at end of file 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..eda3b53f --- /dev/null +++ b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:5.0 + COPY bin/Release/net5.0/publish/ app/ + WORKDIR /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..554ae5bf --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:5.0 + COPY bin/Release/net5.0/publish/ app/ + WORKDIR /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 new file mode 100644 index 00000000..c0dd2b7d --- /dev/null +++ b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile @@ -0,0 +1,4 @@ + FROM mcr.microsoft.com/dotnet/aspnet:5.0 + COPY bin/Release/net5.0/publish/ app/ + WORKDIR /app + ENTRYPOINT ["dotnet", "EShopOnAbp.SaasService.HttpApi.Host.dll"] \ No newline at end of file From 6b2cc4e96f2f1b359862abef2b25355f6f8fdf05 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 7 Oct 2021 15:06:13 +0300 Subject: [PATCH 2/4] added angular dockerfile --- apps/angular/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 apps/angular/Dockerfile diff --git a/apps/angular/Dockerfile b/apps/angular/Dockerfile new file mode 100644 index 00000000..6912e62c --- /dev/null +++ b/apps/angular/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:alpine +WORKDIR /app +COPY dist/EShopOnAbp /usr/share/nginx/html \ No newline at end of file From 38bd5937691ce4f45c8a21620a724c6bcc2fafdd Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 7 Oct 2021 15:13:26 +0300 Subject: [PATCH 3/4] Dockerfile .net version update --- apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile | 4 ++-- apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile | 4 ++-- gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile | 4 ++-- .../web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile | 4 ++-- gateways/web/src/EShopOnAbp.WebGateway/Dockerfile | 4 ++-- .../EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile | 4 ++-- .../src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile | 4 ++-- .../saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile index fc794e5b..9eede96d 100644 --- a/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:5.0 - COPY bin/Release/net5.0/publish/ app/ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ WORKDIR /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 index 5a1602ae..e783fe5e 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:5.0 - COPY bin/Release/net5.0/publish/ app/ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ WORKDIR /app ENTRYPOINT ["dotnet", "EShopOnAbp.PublicWeb.dll"] \ No newline at end of file diff --git a/gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile b/gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile index 51c96f66..2b7cbf5a 100644 --- a/gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile +++ b/gateways/internal/src/EShopOnAbp.InternalGateway/Dockerfile @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:5.0 - COPY bin/Release/net5.0/publish/ app/ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ WORKDIR /app ENTRYPOINT ["dotnet", "EShopOnAbp.InternalGateway.dll"] \ No newline at end of file diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile index 4fa3b189..2d3b43d9 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:5.0 - COPY bin/Release/net5.0/publish/ app/ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ WORKDIR /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 index 896ad6fe..26009670 100644 --- a/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile +++ b/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:5.0 - COPY bin/Release/net5.0/publish/ app/ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ WORKDIR /app ENTRYPOINT ["dotnet", "EShopOnAbp.WebGateway.dll"] \ No newline at end of file diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile index eda3b53f..6767ed03 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile +++ b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:5.0 - COPY bin/Release/net5.0/publish/ app/ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ WORKDIR /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 index 554ae5bf..b9c94610 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:5.0 - COPY bin/Release/net5.0/publish/ app/ + FROM mcr.microsoft.com/dotnet/aspnet:6.0 + COPY bin/Release/net6.0/publish/ app/ WORKDIR /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 c0dd2b7d..505246d8 100644 --- a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile +++ b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/Dockerfile @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:5.0 - COPY bin/Release/net5.0/publish/ app/ + 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 36768b7b8cd11bcdfd868b262fff20d61095a50e Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 7 Oct 2021 15:13:37 +0300 Subject: [PATCH 4/4] Added build image script --- etc/scripts/build-images.ps1 | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 etc/scripts/build-images.ps1 diff --git a/etc/scripts/build-images.ps1 b/etc/scripts/build-images.ps1 new file mode 100644 index 00000000..4e5b07f6 --- /dev/null +++ b/etc/scripts/build-images.ps1 @@ -0,0 +1,74 @@ +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" +$publicWebGatewayFolder = 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 +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 -t eshoponabp/app-authserver:$version . + +### PUBLIC-WEB +Write-Host "*** BUILDING PUBLIC-WEB ****************" -ForegroundColor Green +Set-Location $publicWebFolder +dotnet publish -c Release +docker build -t eshoponabp/app-publicweb:$version . + +### WEB-GATEWAY +Write-Host "*** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green +Set-Location $webGatewayFolder +dotnet publish -c Release +docker build -t eshoponabp/gateway-web:$version . + +### PUBLICWEB-GATEWAY +Write-Host "*** BUILDING PUBLICWEB-GATEWAY ****************" -ForegroundColor Green +Set-Location $publicWebGatewayFolder +dotnet publish -c Release +docker build -t eshoponabp/gateway-publicweb:$version . + +### INTERNAL-GATEWAY +Write-Host "*** BUILDING INTERNAL-GATEWAY ****************" -ForegroundColor Green +Set-Location $internalGatewayFolder +dotnet publish -c Release +docker build -t eshoponabp/gateway-internal:$version . + +### IDENTITY-SERVICE +Write-Host "*** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green +Set-Location $identityServiceFolder +dotnet publish -c Release +docker build -t eshoponabp/service-identity:$version . + +### ADMINISTRATION-SERVICE +Write-Host "*** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green +Set-Location $administrationServiceFolder +dotnet publish -c Release +docker build -t eshoponabp/service-administration:$version . + +### SAAS-SERVICE +Write-Host "*** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green +Set-Location $saasServiceFolder +dotnet publish -c Release +docker build -t eshoponabp/service-saas:$version . + +### ALL COMPLETED +Write-Host "ALL COMPLETED" -ForegroundColor Green +Set-Location $currentFolder \ No newline at end of file