apiVersion: apps/v1
kind: Deployment
metadata:
  name: foldergram
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: foldergram
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: foldergram
    helm.sh/chart: foldergram-5.0.1
  namespace: foldergram
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: main
      app.kubernetes.io/name: foldergram
      app.kubernetes.io/instance: foldergram
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: main
        app.kubernetes.io/instance: foldergram
        app.kubernetes.io/name: foldergram
    spec:
      enableServiceLinks: false
      serviceAccountName: foldergram
      automountServiceAccountToken: false
      securityContext:
        fsGroup: 1000
        fsGroupChangePolicy: OnRootMismatch
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: IMAGE_DETAIL_SOURCE
              value: original
            - name: DERIVATIVE_MODE
              value: lazy
            - name: DATA_ROOT
              value: ./data
            - name: GALLERY_ROOT
              value: /gallery
            - name: CSRF_TRUSTED_ORIGINS
              value: https://foldergram.alexlebens.net, https://art.alexlebens.dev
          image: ghcr.io/foldergram/foldergram:1.2.0@sha256:325e7fcd257cbecaf29a8623cebcbf6f7935fe90454160adf0a43e0a0fcddb91
          name: main
          resources:
            requests:
              cpu: 10m
              memory: 1Gi
          volumeMounts:
            - mountPath: /app/data
              name: data
            - mountPath: /app/data/db
              name: db
            - mountPath: /gallery/Minneapolis Institute of Art
              name: pictures-mia
              readOnly: true
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: foldergram-data
        - name: db
          persistentVolumeClaim:
            claimName: foldergram-db
        - name: pictures-mia
          persistentVolumeClaim:
            claimName: foldergram-pictures-collection-mia-nfs-storage
