diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 989330b..0000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM node:22-alpine AS base -WORKDIR /app - -FROM base AS deps -COPY package.json package-lock.json* ./ -RUN npm install - -FROM base AS builder -COPY --from=deps /app/node_modules ./node_modules -COPY . . -RUN npm run build - -FROM base AS runner -ENV NODE_ENV=production - -RUN addgroup --system --gid 1001 nodejs || true -RUN adduser --system --uid 1001 nextjs || true - -COPY --from=builder /app/public ./public -COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ -COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static - -USER nextjs -EXPOSE 3000 -ENV PORT=3000 -ENV HOSTNAME="0.0.0.0" -CMD ["node", "server.js"] diff --git a/k8s/deployment-gitops.yaml b/k8s/deployment-gitops.yaml deleted file mode 100644 index 38bc94e..0000000 --- a/k8s/deployment-gitops.yaml +++ /dev/null @@ -1,72 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: storefront - namespace: manoonoils - labels: - app: storefront -spec: - replicas: 1 - selector: - matchLabels: - app: storefront - template: - metadata: - labels: - app: storefront - spec: - containers: - - name: storefront - image: node:22-alpine - workingDir: /app - command: - - sh - - -c - - | - if [ ! -d ".git" ]; then - echo "Cloning repository..." - apk add --no-cache git openssh-client - mkdir -p ~/.ssh - ssh-keyscan -p 222 100.74.155.73 >> ~/.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 - else - echo "Pulling latest changes..." - git pull - fi - - echo "Installing dependencies..." - npm ci --legacy-peer-deps - - echo "Building..." - npm run build - - echo "Starting..." - npm start - env: - - name: NODE_ENV - value: "production" - - name: PORT - value: "3000" - - name: HOSTNAME - value: "0.0.0.0" - - name: NEXT_PUBLIC_WOOCOMMERCE_URL - value: "https://manoonoils.com" - - name: NEXT_PUBLIC_WOOCOMMERCE_CONSUMER_KEY - value: "ck_6a62a2ac8fa8d50e4757bf3b35c9d052dbbcf09f" - - name: NEXT_PUBLIC_WOOCOMMERCE_CONSUMER_SECRET - value: "cs_0ea41d2c8fc232d1e609e559ea8561d02c4406ee" - ports: - - containerPort: 3000 - startupProbe: - httpGet: - path: / - port: 3000 - periodSeconds: 10 - failureThreshold: 60 - resources: - requests: - memory: "512Mi" - cpu: "500m" - limits: - memory: "2Gi" - cpu: "1000m" diff --git a/k8s/deployment-simple.yaml b/k8s/deployment-simple.yaml deleted file mode 100644 index d0627ef..0000000 --- a/k8s/deployment-simple.yaml +++ /dev/null @@ -1,100 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: storefront - namespace: manoonoils - labels: - app: storefront -spec: - replicas: 1 - selector: - matchLabels: - app: storefront - template: - metadata: - labels: - app: storefront - spec: - initContainers: - - name: build - image: node:22-alpine - workingDir: /app - command: - - sh - - -c - - | - echo "Installing dependencies..." - npm ci --legacy-peer-deps - echo "Building Next.js app..." - npm run build - echo "Build complete!" - env: - - name: NEXT_PUBLIC_WOOCOMMERCE_URL - value: "https://manoonoils.com" - - name: NEXT_PUBLIC_WOOCOMMERCE_CONSUMER_KEY - value: "ck_6a62a2ac8fa8d50e4757bf3b35c9d052dbbcf09f" - - name: NEXT_PUBLIC_WOOCOMMERCE_CONSUMER_SECRET - value: "cs_0ea41d2c8fc232d1e609e559ea8561d02c4406ee" - - name: NODE_ENV - value: "production" - volumeMounts: - - name: app-code - mountPath: /app - resources: - requests: - memory: "1Gi" - cpu: "500m" - limits: - memory: "2Gi" - cpu: "1000m" - containers: - - name: storefront - image: node:22-alpine - workingDir: /app - command: - - sh - - -c - - | - echo "Starting Next.js..." - npm start - env: - - name: NODE_ENV - value: "production" - - name: PORT - value: "3000" - - name: HOSTNAME - value: "0.0.0.0" - ports: - - containerPort: 3000 - protocol: TCP - startupProbe: - httpGet: - path: / - port: 3000 - periodSeconds: 10 - failureThreshold: 30 - readinessProbe: - httpGet: - path: / - port: 3000 - periodSeconds: 5 - failureThreshold: 3 - livenessProbe: - httpGet: - path: / - port: 3000 - periodSeconds: 10 - failureThreshold: 3 - resources: - requests: - memory: "256Mi" - cpu: "100m" - limits: - memory: "512Mi" - cpu: "500m" - volumeMounts: - - name: app-code - mountPath: /app - volumes: - - name: app-code - emptyDir: {} diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml deleted file mode 100644 index 937e021..0000000 --- a/k8s/deployment.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: storefront - namespace: manoonoils - labels: - app: storefront -spec: - replicas: 1 - selector: - matchLabels: - app: storefront - template: - metadata: - labels: - app: storefront - spec: - containers: - - name: storefront - image: manoonoils-store:latest - imagePullPolicy: Never - 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 - resources: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "512Mi" - cpu: "500m"