apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
  labels:
    app: frontend
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
        - name: frontend
          image: investibook/frontend:latest
          ports:
            - containerPort: 3000
          # NEXT_PUBLIC_API_URL is intentionally NOT set here.
          # It is a build-time variable baked into the Next.js bundle.
          # When unset, the code defaults to '' (relative path), and
          # the Ingress routes /api/* to the backend service directly.
          # Auth0 runtime config is served by the backend at GET /api/config.
          resources:
            requests:
              cpu: "100m"
              memory: "256Mi"
            limits:
              cpu: "500m"
              memory: "512Mi"
      restartPolicy: Always
