apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "formbricks.fullname" . }}
  labels:
    {{- include "formbricks.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "formbricks.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        {{- include "formbricks.selectorLabels" . | nindent 8 }}
    spec:
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - name: http
              containerPort: 3000
              protocol: TCP
          envFrom:
            - secretRef:
                name: {{ include "formbricks.fullname" . }}-secrets
          env:
            {{- range $key, $value := .Values.env }}
            - name: {{ $key }}
              value: {{ $value | quote }}
            {{- end }}
          resources:
            {{- toYaml .Values.resources | nindent 12 }}