diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index a6dcd97..5b20bf9 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -15,29 +15,64 @@ spec: labels: app: storefront spec: + initContainers: + - name: git-clone + image: alpine/git + command: + - sh + - -c + - | + mkdir -p /root/.ssh + ssh-keyscan -p 222 -t rsa 100.74.155.73 > /root/.ssh/known_hosts 2>/dev/null || true + GIT_SSH_COMMAND="ssh -p 222 -o StrictHostKeyChecking=accept-new" git clone ssh://git@100.74.155.73:222/unchained/manoon-headless.git /app-src + volumeMounts: + - name: app-source + mountPath: /app-src + - name: npm-install + image: node:22-alpine + workingDir: /app-src + command: + - npm + - ci + - --legacy-peer-deps + volumeMounts: + - name: app-source + mountPath: /app-src + - name: npm-build + image: node:22-alpine + workingDir: /app-src + command: + - npm + - run + - build + volumeMounts: + - name: app-source + mountPath: /app-src containers: - name: storefront - image: manoonoils-store:repo - imagePullPolicy: Never + image: node:22-alpine + workingDir: /app-src + command: + - npm + - start ports: - containerPort: 3000 - env: - - name: NODE_ENV - value: production - - name: PORT - value: "3000" - - name: HOSTNAME - value: 0.0.0.0 startupProbe: httpGet: path: / port: 3000 periodSeconds: 10 - failureThreshold: 30 + failureThreshold: 60 resources: requests: - memory: "128Mi" + memory: "256Mi" cpu: "100m" limits: memory: "512Mi" cpu: "500m" + volumeMounts: + - name: app-source + mountPath: /app-src + volumes: + - name: app-source + emptyDir: {}