apiVersion: apps/v1
kind: Deployment
metadata:
  name: laravel-documentos
  namespace: mineco-dev
  labels:
    run: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      run: laravel-documentos
  template:
    metadata:
      labels:
        run: laravel-documentos
    spec:
      dnsPolicy: "None"
      dnsConfig:
        nameservers:
          - 128.5.8.26
        searches:
          - mineco-dev.svc.cluster.local
          - svc.cluster.local 
          - cluster.local
        # options:
        #   - name: ndots
        #     value: "2"
        #   - name: edns0
      containers:
      - name: laravel-documentos
        image: jjolon/comercio-dev:latest
        imagePullPolicy: IfNotPresent
        # command: ["composer",'install']
        # args: ["composer","install"]
        # command: ["php","artisan"]
        ports:
          - containerPort: 80
            protocol: TCP
          - containerPort: 25
            protocol: TCP
          - containerPort: 587
            protocol: TCP
          # - containerPort: 443
          #   protocol: TCP
        volumeMounts:
            - mountPath: "/var/www/html"
              name: vol-documento
      # command: ["/usr/local/bin/php", "artisan", "horizon lifecycle: preStop: exec: command: ["/usr/local/bin/php", "artisan", "horizon:terminate"]
      volumes:
        - name: vol-documento
          persistentVolumeClaim:
            claimName: dev-documentos