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 diff --git a/apps/angular/Dockerfile b/apps/angular/Dockerfile index 5f83f0de..837db661 100644 --- a/apps/angular/Dockerfile +++ b/apps/angular/Dockerfile @@ -1,5 +1,15 @@ -FROM nginx:alpine +FROM node:14-alpine as build + WORKDIR /app -COPY dist/EShopOnAbp /usr/share/nginx/html +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 \ No newline at end of file +COPY nginx.conf /etc/nginx/conf.d/default.conf + +COPY --from=build /app/dist/EShopOnAbp/ /usr/share/nginx/html diff --git a/apps/angular/Dockerfile.local b/apps/angular/Dockerfile.local new file mode 100644 index 00000000..5f83f0de --- /dev/null +++ b/apps/angular/Dockerfile.local @@ -0,0 +1,5 @@ +FROM nginx:alpine +WORKDIR /app +COPY dist/EShopOnAbp /usr/share/nginx/html +COPY dynamic-env.json /usr/share/nginx/html +COPY /nginx.conf /etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile index 9eede96d..1bbffe2c 100644 --- a/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile @@ -1,4 +1,53 @@ - 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 +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/auth-server/src/EShopOnAbp.AuthServer/Dockerfile.local b/apps/auth-server/src/EShopOnAbp.AuthServer/Dockerfile.local new file mode 100644 index 00000000..9eede96d --- /dev/null +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/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.AuthServer.dll"] \ No newline at end of file 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 diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile b/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile index e783fe5e..813b2f49 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile @@ -1,4 +1,53 @@ - 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 +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 diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile.local b/apps/public-web/src/EShopOnAbp.PublicWeb/Dockerfile.local new file mode 100644 index 00000000..e783fe5e --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/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.PublicWeb.dll"] \ No newline at end of file diff --git a/build/build-images-locally.ps1 b/build/build-images-locally.ps1 new file mode 100644 index 00000000..cf85bc3f --- /dev/null +++ b/build/build-images-locally.ps1 @@ -0,0 +1,68 @@ +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" + +$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/build/build-images.ps1 b/build/build-images.ps1 new file mode 100644 index 00000000..c85d615c --- /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 $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 . + +### 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 $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 . + +### 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 diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile index 2d3b43d9..ea373981 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/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.WebPublicGateway.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/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 + +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-public/src/EShopOnAbp.WebPublicGateway/Dockerfile.local b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile.local new file mode 100644 index 00000000..2d3b43d9 --- /dev/null +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/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.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 26009670..9ad062f6 100644 --- a/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile +++ b/gateways/web/src/EShopOnAbp.WebGateway/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.WebGateway.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/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 build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.WebGateway.dll"] \ No newline at end of file diff --git a/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile.local b/gateways/web/src/EShopOnAbp.WebGateway/Dockerfile.local new file mode 100644 index 00000000..26009670 --- /dev/null +++ b/gateways/web/src/EShopOnAbp.WebGateway/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.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 6767ed03..d498afbf 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile +++ b/services/administration/src/EShopOnAbp.AdministrationService.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.AdministrationService.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/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/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile.local b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Dockerfile.local new file mode 100644 index 00000000..6767ed03 --- /dev/null +++ b/services/administration/src/EShopOnAbp.AdministrationService.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.AdministrationService.HttpApi.Host.dll"] \ No newline at end of file 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 index b9c94610..a2a86593 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile +++ b/services/identity/src/EShopOnAbp.IdentityService.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.IdentityService.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/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/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile.local b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Dockerfile.local new file mode 100644 index 00000000..b9c94610 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.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.IdentityService.HttpApi.Host.dll"] \ No newline at end of file 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 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 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