apiVersion: apps/v1
kind: Deployment
metadata:
  name: gohorse-backoffice-prd
  namespace: gohorsejobs
spec:
  replicas: 1
  strategy:
    type: Recreate # Crítico para ambientes com pouco recurso
  selector:
    matchLabels:
      app: gohorse-backoffice-prd
  template:
    metadata:
      labels:
        app: gohorse-backoffice-prd
        env: production # Alterado para production
    spec:
      imagePullSecrets:
        - name: harbor-registry
      containers:
        - name: backoffice
          # CORRIGIDO: Removido o "-backoffice" do caminho para bater com o Drone
          image: in.gohorsejobs.com/gohorsejobs/backoffice:latest 
          imagePullPolicy: Always
          ports:
            - containerPort: 8521
          envFrom:
            - secretRef:
                name: backend-secrets
          resources:
            requests:
              memory: "128Mi"
              cpu: "100m"
            limits:
              memory: "512Mi"
              cpu: "500m"