apiVersion: apps/v1 kind: Deployment metadata: name: storefront namespace: manoonoils spec: replicas: 1 selector: matchLabels: app: storefront template: metadata: labels: app: storefront spec: initContainers: - name: clone image: alpine/git:latest command: - sh - -c - | set -e apk add --no-cache git git clone --depth 1 --branch master \ http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git \ /workspace echo "Clone complete." volumeMounts: - name: workspace mountPath: /workspace securityContext: runAsUser: 0 resources: limits: cpu: 500m memory: 256Mi - name: install image: node:20-slim workingDir: /workspace command: - sh - -c - | set -e echo "Installing dependencies..." npm install --prefer-offline --no-audit 2>&1 echo "Dependencies installed." volumeMounts: - name: workspace mountPath: /workspace securityContext: runAsUser: 0 resources: limits: cpu: 2000m memory: 3Gi requests: cpu: 100m memory: 1Gi - name: build image: node:20-slim workingDir: /workspace command: - sh - -c - | set -e echo "Building Next.js app..." npm run build echo "Build complete!" env: - name: NODE_ENV value: "production" - name: NEXT_PUBLIC_SALEOR_API_URL value: "https://api.manoonoils.com/graphql/" - name: NEXT_PUBLIC_SITE_URL value: "https://dev.manoonoils.com" - name: DASHBOARD_URL value: "https://dashboard.manoonoils.com" - name: NEXT_PUBLIC_OPENPANEL_CLIENT_ID value: "fa61f8ae-0b5d-4187-a9b1-5a04b0025674" - name: OPENPANEL_CLIENT_SECRET value: "91126be0d1e78e657e0427df82733832.c6d30edf6ee673da9650a883604169a13ab8579a0dde70cb39b477f4cf441f90" - name: OPENPANEL_API_URL value: "https://op.nodecrew.me/api" volumeMounts: - name: workspace mountPath: /workspace securityContext: runAsUser: 0 resources: limits: cpu: 2000m memory: 2Gi requests: cpu: 100m memory: 512Mi containers: - name: storefront image: node:20-slim workingDir: /workspace command: - npm - start ports: - containerPort: 3000 env: - name: NODE_ENV value: "production" - name: PORT value: "3000" - name: HOSTNAME value: "0.0.0.0" - name: NEXT_PUBLIC_SALEOR_API_URL value: "https://api.manoonoils.com/graphql/" - name: NEXT_PUBLIC_SITE_URL value: "https://dev.manoonoils.com" - name: DASHBOARD_URL value: "https://dashboard.manoonoils.com" - name: RESEND_API_KEY value: "re_bewcjHuy_DHtksWVUxguj8vFzKiJZNkFi" - name: NEXT_PUBLIC_OPENPANEL_CLIENT_ID value: "fa61f8ae-0b5d-4187-a9b1-5a04b0025674" - name: OPENPANEL_CLIENT_SECRET value: "91126be0d1e78e657e0427df82733832.c6d30edf6ee673da9650a883604169a13ab8579a0dde70cb39b477f4cf441f90" - name: OPENPANEL_API_URL value: "https://op.nodecrew.me/api" resources: limits: cpu: 500m memory: 512Mi requests: cpu: 50m memory: 128Mi startupProbe: httpGet: path: /favicon.ico port: 3000 periodSeconds: 10 failureThreshold: 30 livenessProbe: httpGet: path: /favicon.ico port: 3000 periodSeconds: 30 failureThreshold: 3 readinessProbe: httpGet: path: /favicon.ico port: 3000 periodSeconds: 5 failureThreshold: 3 volumeMounts: - name: workspace mountPath: /workspace volumes: - name: workspace emptyDir: sizeLimit: 2Gi