Browse Source

updated angular multistage docker image and script

ipaddr
Galip Tolga Erdem 5 years ago
parent
commit
1fcc2a7734
  1. 15
      apps/angular/Dockerfile
  2. 68
      build/build-images.ps1

15
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

68
build/build-images.ps1

@ -15,49 +15,49 @@ $saasServiceFolder = Join-Path $slnFolder "services/saas/src/EShopOnAbp.SaasServ
Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow
# ### Angular WEB App ### Angular WEB App
# Write-Host "*** BUILDING ANGULAR WEB APPLICATION ***" -ForegroundColor Green Write-Host "*** BUILDING ANGULAR WEB APPLICATION ***" -ForegroundColor Green
# Set-Location $slnFolder Set-Location $webAppFolder
# docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version .
### AUTH-SERVER # ### AUTH-SERVER
Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green # Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green
Set-Location $slnFolder # Set-Location $slnFolder
docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . # docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version .
### PUBLIC-WEB # ### PUBLIC-WEB
Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green # Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green
Set-Location $slnFolder # Set-Location $slnFolder
docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . # docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version .
Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow # Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow
### WEB-GATEWAY # ### WEB-GATEWAY
Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green # Write-Host "**************** BUILDING WEB-GATEWAY ****************" -ForegroundColor Green
Set-Location $slnFolder # Set-Location $slnFolder
docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . # docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version .
### PUBLICWEB-GATEWAY # ### PUBLICWEB-GATEWAY
Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green # Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green
Set-Location $slnFolder # Set-Location $slnFolder
docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . # 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 # ### IDENTITY-SERVICE
Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green # Write-Host "**************** BUILDING IDENTITY-SERVICE ****************" -ForegroundColor Green
Set-Location $slnFolder # Set-Location $slnFolder
docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . # docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version .
### ADMINISTRATION-SERVICE # ### ADMINISTRATION-SERVICE
Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green # Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green
Set-Location $slnFolder # Set-Location $slnFolder
docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . # docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version .
### SAAS-SERVICE # ### SAAS-SERVICE
Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green # Write-Host "**************** BUILDING SAAS-SERVICE ****************" -ForegroundColor Green
Set-Location $slnFolder # Set-Location $slnFolder
docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version . # docker build -f "$saasServiceFolder/Dockerfile" -t eshoponabp/service-saas:$version .
### ALL COMPLETED ### ALL COMPLETED
Write-Host "ALL COMPLETED" -ForegroundColor Green Write-Host "ALL COMPLETED" -ForegroundColor Green

Loading…
Cancel
Save