101 lines
2.3 KiB
YAML
101 lines
2.3 KiB
YAML
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: {}
|