apiVersion: apps/v1
kind: Deployment
metadata:
  name: bossa-box-backend
  labels:
    app: bossa-box-backend
spec:
  replicas: 3
  selector:
    matchLabels:
      app: bossa-box-backend
  template:
    metadata:
      labels:
        app: bossa-box-backend
    spec:
      containers:
        - name: bossa-box-backend
          image: evertontomalok/bossabox-backend-node:latest
          imagePullPolicy: Always
          resources:
            requests:
              memory: "64Mi"
              cpu: "150m"
            limits:
              memory: "640Mi"
              cpu: "450m"
          ports:
            - containerPort: 3000
          env:
            - name: JWT_SECRET
              valueFrom:
                secretKeyRef:
                  name: bossa-box-backend-secrets
                  key: jwt_secret
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: bossa-box-backend-secrets
                  key: db_user
            - name: DB_PW
              valueFrom:
                secretKeyRef:
                  name: bossa-box-backend-secrets
                  key: db_password
            - name: DB_NAME
              value: "backend"
            - name: DB_HOST
              value: "db-postgresql-backend-do-user-7671277-0.b.db.ondigitalocean.com"
            - name: DB_PORT
              value: "25060"
