diff --git a/build/build-images-locally.ps1 b/build/build-images-locally.ps1 index eb9ccc31..7fc395cf 100644 --- a/build/build-images-locally.ps1 +++ b/build/build-images-locally.ps1 @@ -13,45 +13,45 @@ $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp. $administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" ### Angular WEB App(WWW) -Write-Host "*** BUILDING WEB (WWW) ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB (WWW) 1/7 ****************" -ForegroundColor Green Set-Location $webAppFolder yarn # ng build --prod npm run build:prod -docker build -t eshoponabp/app-web:$version . +docker build -f Dockerfile.local -t eshoponabp/app-web:$version . ### AUTH-SERVER -Write-Host "*** BUILDING AUTH-SERVER ****************" -ForegroundColor Green +Write-Host "*** BUILDING AUTH-SERVER 2/7 ****************" -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 +Write-Host "*** BUILDING WEB-PUBLIC 3/7 ****************" -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 +Write-Host "*** BUILDING WEB-GATEWAY 4/7 ****************" -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 +Write-Host "*** BUILDING WEB-PUBLIC-GATEWAY 5/7 ****************" -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 +Write-Host "*** BUILDING IDENTITY-SERVICE 6/7 ****************" -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 +Write-Host "*** BUILDING ADMINISTRATION-SERVICE 7/7 ****************" -ForegroundColor Green Set-Location $administrationServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-administration:$version . diff --git a/build/build-images.ps1 b/build/build-images.ps1 index 25e45dca..9e3999a7 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -15,41 +15,41 @@ $administrationServiceFolder = Join-Path $slnFolder "services/administration/src Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow ### Angular WEB App -Write-Host "*** BUILDING ANGULAR WEB APPLICATION ***" -ForegroundColor Green +Write-Host "*** BUILDING ANGULAR WEB APPLICATION 1/7 ***" -ForegroundColor Green Set-Location $webAppFolder docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . ### AUTH-SERVER -Write-Host "**************** BUILDING AUTH-SERVER ****************" -ForegroundColor Green +Write-Host "**************** BUILDING AUTH-SERVER 2/7 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . ### PUBLIC-WEB -Write-Host "**************** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-PUBLIC 3/7 ****************" -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 +Write-Host "**************** BUILDING WEB-GATEWAY 4/7 ****************" -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 +Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY 5/7 ****************" -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 +Write-Host "**************** BUILDING IDENTITY-SERVICE 6/7 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . ### ADMINISTRATION-SERVICE -Write-Host "**************** BUILDING ADMINISTRATION-SERVICE ****************" -ForegroundColor Green +Write-Host "**************** BUILDING ADMINISTRATION-SERVICE 7/7 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . diff --git a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml index ec5107b2..3ac0b8fe 100644 --- a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml @@ -28,9 +28,9 @@ spec: - name: App__RedirectAllowedUrls value: "{{ .Values.config.allowedRedirectUrls }}" - name: "ConnectionStrings__IdentityService" - value: "{{ .Values.config.identityService.connString }}" + value: "{{ .Values.config.connectionStrings.identityService }}" - name: "ConnectionStrings__AdministrationService" - value: "{{ .Values.config.administrationService.connString }}" + value: "{{ .Values.config.connectionStrings.administrationService }}" - name: "DOTNET_ENVIRONMENT" value: "{{ .Values.config.dotnetEnv }}" - name: "Redis__Configuration" diff --git a/etc/k8s/eshoponabp/charts/authserver/values.yaml b/etc/k8s/eshoponabp/charts/authserver/values.yaml index fb08bbec..d80adc30 100644 --- a/etc/k8s/eshoponabp/charts/authserver/values.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/values.yaml @@ -2,10 +2,9 @@ config: selfUrl: # https://eshop-st-authserver corsOrigins: # https://eshop-st-identity,https://eshop-st-administration allowedRedirectUrls: https://eshop-st-web - identityService: - connString: # - administrationService: - connString: # + connectionStrings: + administrationService: # + identityService: # dotnetEnv: # redisHost: # rabbitmqHost: # diff --git a/etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml b/etc/k8s/eshoponabp/charts/postgres/Chart.yaml similarity index 54% rename from etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml rename to etc/k8s/eshoponabp/charts/postgres/Chart.yaml index 647c03d2..eaddf3fb 100644 --- a/etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml +++ b/etc/k8s/eshoponabp/charts/postgres/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: sqldb +name: postgresdb appVersion: "1.0" -description: Runs SQL Server Instance +description: Runs Postgres DB Instance version: 1.0.0 type: application diff --git a/etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver.yaml b/etc/k8s/eshoponabp/charts/postgres/templates/postgres-deployment.yaml similarity index 73% rename from etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver.yaml rename to etc/k8s/eshoponabp/charts/postgres/templates/postgres-deployment.yaml index dfe41eb8..7597b4d7 100644 --- a/etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver.yaml +++ b/etc/k8s/eshoponabp/charts/postgres/templates/postgres-deployment.yaml @@ -14,22 +14,20 @@ spec: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - image: mcr.microsoft.com/mssql/server + - image: postgres name: {{ .Release.Name }}-{{ .Chart.Name }} {{- if eq .Release.Name "es-az" }} volumeMounts: - - mountPath: "/var/opt/mssql" + - mountPath: "/var/opt/postgres" name: {{ .Release.Name }}-{{ .Chart.Name }}-database-volume - subPath: sqlserver-data + subPath: postgres-data {{- end }} ports: - - name: sqlserver - containerPort: 1433 + - name: postgres + containerPort: 5432 env: - - name: SA_PASSWORD - value: "myPassw@rd" - - name: ACCEPT_EULA - value: "Y" + - name: POSTGRES_PASSWORD + value: "myPassw0rd" {{- if eq .Release.Name "es-az" }} volumeClaimTemplates: - metadata: diff --git a/etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver-service.yaml b/etc/k8s/eshoponabp/charts/postgres/templates/postgres-service.yaml similarity index 85% rename from etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver-service.yaml rename to etc/k8s/eshoponabp/charts/postgres/templates/postgres-service.yaml index 653493f7..f17e1ba3 100644 --- a/etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver-service.yaml +++ b/etc/k8s/eshoponabp/charts/postgres/templates/postgres-service.yaml @@ -7,8 +7,8 @@ metadata: spec: type: ClusterIP ports: - - name: sqlserver - port: 1433 + - name: postgres + port: 5432 selector: app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/sqlserver/values.yaml b/etc/k8s/eshoponabp/charts/postgres/values.yaml similarity index 100% rename from etc/k8s/eshoponabp/charts/sqlserver/values.yaml rename to etc/k8s/eshoponabp/charts/postgres/values.yaml diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 35640471..1cbd9878 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -4,10 +4,9 @@ authserver: selfUrl: https://eshop-st-authserver corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal allowedRedirectUrls: https://eshop-st-web - identityService: - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" - administrationService: - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + connectionStrings: + administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + identityService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Identity;User ID=postgres;password=myPassw0rd;Pooling=false" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -53,8 +52,8 @@ identity: selfUrl: https://eshop-st-identity corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public connectionStrings: - identityService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" - administrationService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + identityService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Identity;User ID=postgres;password=myPassw0rd;Pooling=false" + administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" @@ -82,7 +81,7 @@ administration: gatewayUrl: https://eshop-st-gateway-internal/ corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal connectionStrings: - administrationService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false"