apiVersion: apps/v1
kind: Deployment
metadata:
  name: invoices-api
spec:
  selector:
    matchLabels:
      app: invoices-api
  template:
    metadata:
      labels:
        app: invoices-api
    spec:
      containers:
      - name: invoices-api
        image: omurilo/imersao3-invoices-api:latest
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
        - containerPort: 3000
        volumeMounts:
          - name: invoices-api-volume
            mountPath: /home/node/app/.env
            subPath: .env
            
      volumes:
        - name: invoices-api-volume
          configMap:
            name: invoices-api-conf
            items:
              - key: env
                path: .env
