apiVersion: apps/v1
kind: Deployment
metadata:
  name: erabliereapi-deployment
  labels:
    app: erabliereapi
spec:
  replicas: 1
  selector:
    matchLabels:
      app: erabliereapi
  template:
    metadata:
      labels:
        app: erabliereapi
    spec:
      containers:
      - name: erabliereapi
        image: erabliereapi/erabliereapi:v2
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        env:
        - name: ASPNETCORE_ENVIRONMENT
          value: "Staging"
        - name: USE_SQL
          value: "true"
        - name: SQL_CONNEXION_STRING
          valueFrom:
            secretKeyRef:
              name: erabliereapi-sql-credentials
              key: connexionstring
        - name: SQL_USE_STARTUP_MIGRATION
          value: "true"
        - name: USE_AUTHENTICATION
          value: "false"
        - name: EMAIL_CONFIG_PATH
          value: "/app/secret/emailConfig.json"
      volumes:
      - name: erabliereapi-sql-credentials
        secret:
          secretName: erabliereapi-sql-credentials