diff --git a/build/build-images-locally.ps1 b/build/build-images-locally.ps1 index 7fc395cf..ec8abf2e 100644 --- a/build/build-images-locally.ps1 +++ b/build/build-images-locally.ps1 @@ -2,18 +2,25 @@ param ($version='latest') $currentFolder = $PSScriptRoot $slnFolder = Join-Path $currentFolder "../" +# Apps $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" - +# Gateways $webGatewayFolder = Join-Path $slnFolder "gateways/web/src/EShopOnAbp.WebGateway" $webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" - +# Microservices $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" $administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +$basketServiceFolder = Join-Path $slnFolder "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host" +$catalogServiceFolder = Join-Path $slnFolder "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host" +$paymentServiceFolder = Join-Path $slnFolder "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host" +$orderingServiceFolder = Join-Path $slnFolder "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host" + +$total = 11 ### Angular WEB App(WWW) -Write-Host "*** BUILDING WEB (WWW) 1/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB (WWW) 1/$total ****************" -ForegroundColor Green Set-Location $webAppFolder yarn # ng build --prod @@ -21,41 +28,65 @@ npm run build:prod docker build -f Dockerfile.local -t eshoponabp/app-web:$version . ### AUTH-SERVER -Write-Host "*** BUILDING AUTH-SERVER 2/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING AUTH-SERVER 2/$total ****************" -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 3/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-PUBLIC 3/$total ****************" -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 4/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-GATEWAY 4/$total ****************" -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 5/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-PUBLIC-GATEWAY 5/$total ****************" -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 6/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING IDENTITY-SERVICE 6/$total ****************" -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 7/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING ADMINISTRATION-SERVICE 7/$total ****************" -ForegroundColor Green Set-Location $administrationServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-administration:$version . +### BASKET-SERVICE +Write-Host "**************** BUILDING BASKET-SERVICE 8/$total ****************" -ForegroundColor Green +Set-Location $basketServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-basket:$version . + +### CATALOG-SERVICE +Write-Host "**************** BUILDING CATALOG-SERVICE 9/$total ****************" -ForegroundColor Green +Set-Location $catalogServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-catalog:$version . + +### PAYMENT-SERVICE +Write-Host "**************** BUILDING PAYMENT-SERVICE 10/$total ****************" -ForegroundColor Green +Set-Location $paymentServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-payment:$version . + +### ORDERING-SERVICE +Write-Host "**************** BUILDING ORDERING-SERVICE 11/$total ****************" -ForegroundColor Green +Set-Location $orderingServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-ordering:$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 index 9e3999a7..e5f7c3a2 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -1,58 +1,85 @@ -param ($version='1.0') +param ($version='latest') $currentFolder = $PSScriptRoot $slnFolder = Join-Path $currentFolder "../" +# Apps $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" - +# Gateways $webGatewayFolder = Join-Path $slnFolder "gateways/web/src/EShopOnAbp.WebGateway" $webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" - +# Microservices $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" $administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +$basketServiceFolder = Join-Path $slnFolder "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host" +$catalogServiceFolder = Join-Path $slnFolder "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host" +$paymentServiceFolder = Join-Path $slnFolder "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host" +$orderingServiceFolder = Join-Path $slnFolder "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host" + +$total = 11 Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow ### Angular WEB App -Write-Host "*** BUILDING ANGULAR WEB APPLICATION 1/7 ***" -ForegroundColor Green +Write-Host "*** BUILDING ANGULAR WEB APPLICATION 1/$total ***" -ForegroundColor Green Set-Location $webAppFolder docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . ### AUTH-SERVER -Write-Host "**************** BUILDING AUTH-SERVER 2/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING AUTH-SERVER 2/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . ### PUBLIC-WEB -Write-Host "**************** BUILDING WEB-PUBLIC 3/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-PUBLIC 3/$total ****************" -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 4/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-GATEWAY 4/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . ### PUBLICWEB-GATEWAY -Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY 5/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY 5/$total ****************" -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 6/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING IDENTITY-SERVICE 6/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . ### ADMINISTRATION-SERVICE -Write-Host "**************** BUILDING ADMINISTRATION-SERVICE 7/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING ADMINISTRATION-SERVICE 7/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . +### BASKET-SERVICE +Write-Host "**************** BUILDING BASKET-SERVICE 8/$total ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$basketServiceFolder/Dockerfile" -t eshoponabp/service-basket:$version . + +### CATALOG-SERVICE +Write-Host "**************** BUILDING CATALOG-SERVICE 9/$total ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$catalogServiceFolder/Dockerfile" -t eshoponabp/service-catalog:$version . + +### PAYMENT-SERVICE +Write-Host "**************** BUILDING PAYMENT-SERVICE 10/$total ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$paymentServiceFolder/Dockerfile" -t eshoponabp/service-payment:$version . + +### ORDERING-SERVICE +Write-Host "**************** BUILDING ORDERING-SERVICE 11/$total ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$orderingServiceFolder/Dockerfile" -t eshoponabp/service-ordering:$version . + ### ALL COMPLETED Write-Host "ALL COMPLETED" -ForegroundColor Green Set-Location $currentFolder \ No newline at end of file diff --git a/etc/README.md b/etc/README.md index 166c6502..3ff8d9a0 100644 --- a/etc/README.md +++ b/etc/README.md @@ -23,6 +23,10 @@ helm install ingress-nginx ingress-nginx/ingress-nginx 127.0.0.1 eshop-st-authserver 127.0.0.1 eshop-st-identity 127.0.0.1 eshop-st-administration +127.0.0.1 eshop-st-basket +127.0.0.1 eshop-st-catalog +127.0.0.1 eshop-st-ordering +127.0.0.1 eshop-st-payment 127.0.0.1 eshop-st-gateway-web 127.0.0.1 eshop-st-gateway-web-public ```` diff --git a/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml b/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml index 2b506bad..7ddc0fe4 100644 --- a/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml @@ -23,8 +23,10 @@ spec: env: - name: App__SelfUrl value: "{{ .Values.config.selfUrl }}" - - name: RemoteServices__Default__BaseUrl - value: "{{ .Values.config.gatewayUrl }}" + - name: RemoteServices__AbpIdentity__BaseUrl + value: "{{ .Values.config.remoteServices.abpIdentityBaseUrl }}" + - name: RemoteServices__AbpIdentity__UseCurrentAccessToken + value: "{{ .Values.config.remoteServices.useCurrentToken }}" - name: App__CorsOrigins value: "{{ .Values.config.corsOrigins }}" - name: IdentityClients__Default__Authority @@ -39,6 +41,10 @@ spec: value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "StringEncryption__DefaultPassPhrase" value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "RabbitMQ__Connections__Default__HostName" diff --git a/etc/k8s/eshoponabp/charts/administration/values.yaml b/etc/k8s/eshoponabp/charts/administration/values.yaml index 26aefe9d..5b0f6c97 100644 --- a/etc/k8s/eshoponabp/charts/administration/values.yaml +++ b/etc/k8s/eshoponabp/charts/administration/values.yaml @@ -1,12 +1,16 @@ config: selfUrl: # https://eshop-st-administration - gatewayUrl: # https://eshop-st-gateway-internal/ corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal connectionStrings: administrationService: # authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + remoteServices: + abpIdentityBaseUrl: # + useCurrentToken: "false" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq diff --git a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml index 3ac0b8fe..7db227d3 100644 --- a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml @@ -31,6 +31,14 @@ spec: value: "{{ .Values.config.connectionStrings.identityService }}" - name: "ConnectionStrings__AdministrationService" value: "{{ .Values.config.connectionStrings.administrationService }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - 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 d80adc30..95f80979 100644 --- a/etc/k8s/eshoponabp/charts/authserver/values.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/values.yaml @@ -4,7 +4,12 @@ config: allowedRedirectUrls: https://eshop-st-web connectionStrings: administrationService: # - identityService: # + identityService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: # redisHost: # rabbitmqHost: # diff --git a/etc/k8s/eshoponabp/charts/basket/Chart.yaml b/etc/k8s/eshoponabp/charts/basket/Chart.yaml new file mode 100644 index 00000000..ca500582 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: basket +appVersion: "1.0" +description: eShopOnAbp Basket Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml b/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml new file mode 100644 index 00000000..8105cacf --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + - name: "RemoteServices__Catalog__BaseUrl" + value: "{{ .Values.config.remoteServices.catalogBaseUrl }}" + - name: "RemoteServices__Catalog__GrpcUrl" + value: "{{ .Values.config.remoteServices.catalogGrpcUrl }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/basket/templates/basket-ingress.yaml b/etc/k8s/eshoponabp/charts/basket/templates/basket-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/templates/basket-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/basket/templates/basket-service.yaml b/etc/k8s/eshoponabp/charts/basket/templates/basket-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/templates/basket-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/basket/values.yaml b/etc/k8s/eshoponabp/charts/basket/values.yaml new file mode 100644 index 00000000..5571e666 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/values.yaml @@ -0,0 +1,30 @@ +config: + selfUrl: # https://eshop-st-basket + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-public + connectionStrings: + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: "WebGateway_Swagger" + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + remoteServices: + catalogBaseUrl: # + catalogGrpcUrl: # + +ingress: + host: eshop-st-basket + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-basket + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/catalog/Chart.yaml b/etc/k8s/eshoponabp/charts/catalog/Chart.yaml new file mode 100644 index 00000000..e8109a51 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: catalog +appVersion: "1.0" +description: eShopOnAbp Catalog Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml new file mode 100644 index 00000000..17aef76c --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + - name: grpc + containerPort: 81 + protocol: TCP + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__CatalogService" + value: {{ .Values.config.connectionStrings.catalogService }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + - name: "Kestrel__Endpoints__Http__Url" + value: "{{ .Values.config.kestrel.httpUrl }}" + - name: "Kestrel__Endpoints__Http__Protocols" + value: "{{ .Values.config.kestrel.httpProtocols }}" + - name: "Kestrel__Endpoints__gRPC__Url" + value: "{{ .Values.config.kestrel.grpcUrl }}" + - name: "Kestrel__Endpoints__gRPC__Protocols" + value: "{{ .Values.config.kestrel.grpcProtocols }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/catalog/templates/catalog-ingress.yaml b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/catalog/templates/catalog-service.yaml b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-service.yaml new file mode 100644 index 00000000..278771cd --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + - port: {{ .Values.config.grpcPort }} + targetPort: grpc + protocol: TCP + name: grpc + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/catalog/values.yaml b/etc/k8s/eshoponabp/charts/catalog/values.yaml new file mode 100644 index 00000000..d45c8b9e --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/values.yaml @@ -0,0 +1,35 @@ +config: + selfUrl: # https://eshop-st-catalog + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-public,https://eshop-st-web + connectionStrings: + catalogService: # + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + grpcPort: 81 + kestrel: + httpUrl: # + httpProtocols: Http1AndHttp2 + grpcUrl: # + grpcProtocols: Http2 + + +ingress: + host: eshop-st-catalog + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-catalog + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml index 88f4794e..809ea92d 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml @@ -61,11 +61,11 @@ data: { "ServiceKey": "Ordering Service", "DownstreamPathTemplate": "/api/ordering/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.orderService.schema }}", + "DownstreamScheme": "{{ .Values.reRoutes.orderingService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "{{ .Values.reRoutes.orderService.host }}", - "Port": "{{ .Values.reRoutes.orderService.port }}", + "Host": "{{ .Values.reRoutes.orderingService.host }}", + "Port": "{{ .Values.reRoutes.orderingService.port }}", } ], "UpstreamPathTemplate": "/api/ordering/{everything}", diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml index a64d660e..910a6606 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml @@ -38,7 +38,11 @@ spec: - name: "AuthServer__Authority" value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" - value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "ElasticSearch__Url" value: "{{ .Values.config.elasticsearchHost }}" - name: "StringEncryption__DefaultPassPhrase" diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml index 321eeaca..002e5667 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml @@ -3,7 +3,9 @@ config: globalConfigurationBaseUrl: http://eshop-st-gateway-public-web authServer: authority: http://eshop-st-authserver - requireHttpsMetadata: "false" + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -27,9 +29,9 @@ reRoutes: schema: http host: eshop-st-basket port: 80 - orderService: + orderingService: schema: http - host: eshop-st-order + host: eshop-st-ordering port: 80 ingress: diff --git a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml index 75e1f1a0..25b3f694 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml @@ -40,7 +40,11 @@ spec: - name: "AuthServer__Authority" value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" - value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "ElasticSearch__Url" value: "{{ .Values.config.elasticsearchHost }}" - name: "StringEncryption__DefaultPassPhrase" diff --git a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml index 40195ae2..a80b0b01 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml @@ -4,7 +4,9 @@ config: globalConfigurationBaseUrl: # http://eshop-st-gateway-web authServer: authority: http://eshop-st-authserver - requireHttpsMetadata: "false" + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: # redisHost: # rabbitmqHost: # diff --git a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml index a7adf73a..00509ce0 100644 --- a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml @@ -41,22 +41,34 @@ spec: value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "StringEncryption__DefaultPassPhrase" value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "IdentityServerClients__Web__RootUrl" value: {{ .Values.identityServerClients.webRootUrl }} - name: "IdentityServerClients__PublicWeb__RootUrl" value: {{ .Values.identityServerClients.publicWebRootUrl }} + - name: "IdentityServerClients__PublicWebGateway__RootUrl" + value: {{ .Values.identityServerClients.publicWebGatewayRootUrl }} + - name: "IdentityServerClients__WebGateway__RootUrl" + value: {{ .Values.identityServerClients.webGatewayRootUrl }} - name: "IdentityServerClients__IdentityService__RootUrl" value: {{ .Values.identityServerClients.identityServiceRootUrl }} - name: "IdentityServerClients__AdministrationService__RootUrl" value: {{ .Values.identityServerClients.administrationServiceRootUrl }} - - name: "IdentityServerClients__InternalGateway__RootUrl" - value: {{ .Values.identityServerClients.webRootUrl }} - - name: "IdentityServerClients__PublicWebGateway__RootUrl" - value: {{ .Values.identityServerClients.publicWebRootUrl }} - - name: "IdentityServerClients__WebGateway__RootUrl" - value: {{ .Values.identityServerClients.webGatewayRootUrl }} + - name: "IdentityServerClients__AccountService__RootUrl" + value: {{ .Values.identityServerClients.accountServiceRootUrl }} + - name: "IdentityServerClients__BasketService__RootUrl" + value: {{ .Values.identityServerClients.basketServiceRootUrl }} + - name: "IdentityServerClients__CatalogService__RootUrl" + value: {{ .Values.identityServerClients.catalogServiceRootUrl }} + - name: "IdentityServerClients__OrderingService__RootUrl" + value: {{ .Values.identityServerClients.orderingServiceRootUrl }} + - name: "IdentityServerClients__PaymentService__RootUrl" + value: {{ .Values.identityServerClients.paymentServiceRootUrl }} {{- if .Values.env }} {{ toYaml .Values.env | indent 8 }} {{- end }} diff --git a/etc/k8s/eshoponabp/charts/identity/values.yaml b/etc/k8s/eshoponabp/charts/identity/values.yaml index 3710c1b7..f7f0faa7 100644 --- a/etc/k8s/eshoponabp/charts/identity/values.yaml +++ b/etc/k8s/eshoponabp/charts/identity/values.yaml @@ -7,6 +7,8 @@ config: authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -19,8 +21,14 @@ identityServerClients: publicWebRootUrl: # webGatewayRootUrl: # publicWebGatewayRootUrl: # + accountServiceRootUrl: # identityServiceRootUrl: # administrationServiceRootUrl: # + basketServiceRootUrl: # + catalogServiceRootUrl: # + orderingServiceRootUrl: # + paymentServiceRootUrl: # + ingress: host: eshop-st-identity diff --git a/etc/k8s/eshoponabp/charts/ordering/Chart.yaml b/etc/k8s/eshoponabp/charts/ordering/Chart.yaml new file mode 100644 index 00000000..08460269 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: ordering +appVersion: "1.0" +description: eShopOnAbp Ordering Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/ordering/templates/ordering-deployment.yaml b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-deployment.yaml new file mode 100644 index 00000000..78bcb82e --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__OrderingService" + value: {{ .Values.config.connectionStrings.orderingService }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/ordering/templates/ordering-ingress.yaml b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/ordering/templates/ordering-service.yaml b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/ordering/values.yaml b/etc/k8s/eshoponabp/charts/ordering/values.yaml new file mode 100644 index 00000000..70949147 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/values.yaml @@ -0,0 +1,28 @@ +config: + selfUrl: # https://eshop-st-ordering + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web + connectionStrings: + orderingService: # + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: eshop-st-ordering + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-ordering + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/payment/Chart.yaml b/etc/k8s/eshoponabp/charts/payment/Chart.yaml new file mode 100644 index 00000000..1cb23f7c --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: payment +appVersion: "1.0" +description: eShopOnAbp Payment Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml new file mode 100644 index 00000000..c3526b1b --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__PaymentService" + value: {{ .Values.config.connectionStrings.paymentService }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/payment/values.yaml b/etc/k8s/eshoponabp/charts/payment/values.yaml new file mode 100644 index 00000000..a4f316a0 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/values.yaml @@ -0,0 +1,28 @@ +config: + selfUrl: # https://eshop-st-payment + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web + connectionStrings: + paymentService: # + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: eshop-st-payment + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-payment + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 1cbd9878..ab84ca38 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -2,7 +2,7 @@ authserver: config: selfUrl: https://eshop-st-authserver - corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-identity,https://eshop-st-administration,https://eshop-st-basket,https://eshop-st-catalog,https://eshop-st-ordering,https://eshop-st-payment allowedRedirectUrls: https://eshop-st-web connectionStrings: administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" @@ -57,6 +57,8 @@ identity: authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -68,6 +70,11 @@ identity: publicWebGatewayRootUrl: https://eshop-st-gateway-web-public/ identityServiceRootUrl: https://eshop-st-identity/ administrationServiceRootUrl: https://eshop-st-administration/ + accountServiceRootUrl: https://eshop-st-authserver/ + basketServiceRootUrl: https://eshop-st-basket/ + catalogServiceRootUrl: https://eshop-st-catalog/ + orderingServiceRootUrl: https://eshop-st-ordering/ + paymentServiceRootUrl: https://eshop-st-payment/ ingress: host: eshop-st-identity image: @@ -78,13 +85,17 @@ identity: administration: config: selfUrl: https://eshop-st-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: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + remoteServices: + abpIdentityBaseUrl: https://eshop-st-identity + useCurrentToken: "false" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -106,6 +117,8 @@ gateway-web: authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -132,8 +145,10 @@ gateway-web-public: selfUrl: https://eshop-st-gateway-web-public globalConfigurationBaseUrl: http://eshop-st-gateway-public-web authServer: - authority: http://eshop-st-AUTHSERVER + authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -161,11 +176,109 @@ gateway-web-public: schema: http host: eshop-st-basket port: 80 - orderService: + orderingService: schema: http - host: eshop-st-order + host: eshop-st-ordering port: 80 +# basket-service sub-chart override +basket: + config: + selfUrl: https://eshop-st-basket + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-public-web + connectionStrings: + 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" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + remoteServices: + catalogBaseUrl: http://eshop-st-catalog + catalogGrpcUrl: http://eshop-st-catalog + ingress: + host: eshop-st-basket + image: + repository: "eshoponabp/service-basket" + tag: latest + +# catalog-service sub-chart override +catalog: + config: + selfUrl: https://eshop-st-catalog + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-public-web,https://eshop-st-web + connectionStrings: + catalogService: "mongodb://es-st-mongodb/EShopOnAbp_Catalog" + 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" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + kestrel: + httpUrl: http://eshop-st-catalog:80 + httpProtocols: Http1AndHttp2 + grpcUrl: http://eshop-st-catalog:81 + grpcProtocols: Http2 + ingress: + host: eshop-st-catalog + image: + repository: "eshoponabp/service-catalog" + tag: latest + +# ordering-service sub-chart override +ordering: + config: + selfUrl: https://eshop-st-ordering + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public + connectionStrings: + orderingService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Ordering;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" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + ingress: + host: eshop-st-ordering + image: + repository: "eshoponabp/service-ordering" + tag: latest + +# payment-service sub-chart override +payment: + config: + selfUrl: https://eshop-st-payment + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public + connectionStrings: + paymentService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Payment;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" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + ingress: + host: eshop-st-payment + image: + repository: "eshoponabp/service-payment" + tag: latest # Default values for eshoponabp. # This is a YAML-formatted file. diff --git a/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile b/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..9279ab5a --- /dev/null +++ b/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile @@ -0,0 +1,51 @@ +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/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/basket/src/EShopOnAbp.BasketService.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.BasketService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..fba2a67e --- /dev/null +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile @@ -0,0 +1,51 @@ +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/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/catalog/src/EShopOnAbp.CatalogService.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.CatalogService.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 index 28dcb67f..1811b197 100644 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local @@ -1,4 +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 +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/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..32da73fa --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile @@ -0,0 +1,51 @@ +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/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/ordering/src/EShopOnAbp.OrderingService.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.OrderingService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..87dddaa6 --- /dev/null +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile @@ -0,0 +1,51 @@ +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/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/payment/src/EShopOnAbp.PaymentService.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.PaymentService.HttpApi.Host.dll"] \ No newline at end of file