diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index b7874c9..1166868 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -67,7 +67,7 @@ jobs: --min-instances 1 --concurrency 80 --allow-unauthenticated - --ingress=internal + --ingress=all timeout: 600s @@ -105,6 +105,7 @@ jobs: --max-instances 3 --min-instances 1 --concurrency 100 - --ingress=internal-and-cloud-load-balancing + --allow-unauthenticated + --ingress=all timeout: 600s diff --git a/apps/client/Dockerfile b/apps/client/Dockerfile index f1857e7..0004152 100644 --- a/apps/client/Dockerfile +++ b/apps/client/Dockerfile @@ -31,7 +31,6 @@ RUN apk add --no-cache gettext COPY apps/client/env.sh /docker-entrypoint.d/40-env.sh -RUN chmod +x /docker-entrypoint.d/40-env.sh RUN chown -R nginx:nginx /usr/share/nginx/html && \ chmod -R 755 /usr/share/nginx/html && \ diff --git a/apps/client/env.sh b/apps/client/env.sh deleted file mode 100644 index 7cd3d5a..0000000 --- a/apps/client/env.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[INFO] $1" -} - -if [ -z "$API_URL" ]; then - echo "[ERROR] API_URL environment variable is not set." - exit 1 -fi - -log "Replacing API_URL in main JavaScript files" - -find /usr/share/nginx/html/ -name 'main*.js' -exec sed -i 's|apiUrl:[^,]*|apiUrl:"'"${API_URL}"'"|g' {} + - -log "API_URL successfully replaced in JavaScript files" - -log "Verifying changes in JavaScript files" -for file in /usr/share/nginx/html/main*.js; do - head -n 5 "$file" -done - -log "Script completed successfully" diff --git a/apps/client/src/environments/environment.prod.ts b/apps/client/src/environments/environment.prod.ts index 521e3d0..bfec026 100644 --- a/apps/client/src/environments/environment.prod.ts +++ b/apps/client/src/environments/environment.prod.ts @@ -1,5 +1,4 @@ export const environment = { production: true, - // apiUrl: typeof window !== 'undefined' ? window.location.origin + '/api/v1' : '${API_URL}/api/v1' apiUrl: 'API_URL_PLACEHOLDER/api/v1' }; diff --git a/apps/server/src/shared/origins.ts b/apps/server/src/shared/origins.ts index 234e8bb..b8a08d1 100644 --- a/apps/server/src/shared/origins.ts +++ b/apps/server/src/shared/origins.ts @@ -1,5 +1,5 @@ export const ORIGINS = [ - "https://34.1.32.26", - "https://rnd-platform-client-app-p5qzcycuqa-ww.a.run.app", - "http://localhost:4200", + "https://34.1.32.26/*", + "https://rnd-platform-client-app-p5qzcycuqa-ww.a.run.app/*", + "http://localhost:4200/*", ] diff --git a/k8s/manifests.yaml b/k8s/manifests.yaml deleted file mode 100644 index 2c0c5d4..0000000 --- a/k8s/manifests.yaml +++ /dev/null @@ -1,118 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: server-deployment -spec: - replicas: 2 - selector: - matchLabels: - app: server - template: - metadata: - labels: - app: server - spec: - containers: - - name: server - image: LOCATION-docker.pkg.dev/PROJECT_ID/REPO_NAME/server:TAG - ports: - - containerPort: 3000 - env: - - name: PROD_MONGODB_URI - valueFrom: - secretKeyRef: - name: app-secrets - key: MongodbURIKey - - name: JWT_SECRET - valueFrom: - secretKeyRef: - name: app-secrets - key: JwtKey - - name: JWT_EXPIRATION - value: "8h" - ---- -apiVersion: v1 -kind: Service -metadata: - name: server-service -spec: - selector: - app: server - ports: - - protocol: TCP - port: 80 - targetPort: 3000 - type: ClusterIP ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: client-deployment -spec: - replicas: 2 - selector: - matchLabels: - app: client - template: - metadata: - labels: - app: client - spec: - containers: - - name: client - image: LOCATION-docker.pkg.dev/PROJECT_ID/REPO_NAME/client:TAG - ports: - - containerPort: 80 - env: - - name: API_URL - value: "http://server-service.ENVIRONMENT_NAMESPACE.svc.cluster.local" ---- -apiVersion: v1 -kind: Service -metadata: - name: client-service -spec: - selector: - app: client - ports: - - protocol: TCP - port: 80 - targetPort: 80 - type: ClusterIP ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: rnd-platform-ingress - annotations: - kubernetes.io/ingress.class: nginx - cert-manager.io/cluster-issuer: "letsencrypt-prod" - kubernetes.io/ingress.global-static-ip-name: "STATIC_IP_NAME_PLACEHOLDER" -spec: - tls: - - hosts: - - rndplatform.juriba.info - secretName: rnd-platform-tls - rules: - - host: rndplatform.juriba.info - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: client-service - port: - number: 80 - ---- -apiVersion: v1 -kind: Secret -metadata: - name: app-secrets -type: Opaque -stringData: - MongodbURIKey: "MONGODB_URI_SECRET" - JwtKey: "JWT_KEY_SECRET"