From 1fcc2a7734f31b6f58e4e8d23dadf17bd38e202c Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 8 Nov 2021 20:05:04 +0300 Subject: [PATCH] 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