apiVersion: apps/v1
kind: Deployment
metadata:
  name: photoprism
  namespace: photoprism
spec:
  replicas: 1
  selector:
    matchLabels:
      app: photoprism
  template:
    metadata:
      labels:
        app: photoprism
    spec:
      containers:
        - name: photoprism
          image: photoprism/photoprism
          env:
            - name: PHOTOPRISM_ADMIN_USER
              value: admin
            - name: PHOTOPRISM_ADMIN_PASSWORD
              value: photoprism
            - name: PHOTOPRISM_AUTH_MODE
              value: password
            - name: PHOTOPRISM_SITE_URL
              value: https://henrysfotos.henryathome.home64.de
            - name: PHOTOPRISM_INDEX_WORKERS
              value: "3"
            - name: PHOTOPRISM_INDEX_SCHEDULE
              value: "@every 3h"
            # DB
            - name: PHOTOPRISM_DATABASE_DRIVER
              value: mysql
            - name: PHOTOPRISM_DATABASE_SERVER
              value: mariadb:3306
            - name: PHOTOPRISM_DATABASE_NAME
              value: photoprism
            - name: PHOTOPRISM_DATABASE_USER
              value: photoprism
            - name: PHOTOPRISM_DATABASE_PASSWORD
              value: photoprism
            - name: PHOTOPRISM_UID
              value: "1001"
            - name: PHOTOPRISM_GID
              value: "1000"
            - name: PHOTOPRISM_DISABLE_CHOWN
              value: "true"
            - name: PHOTOPRISM_SIDECAR_JSON
              value: "true"
            - name: PHOTOPRISM_OIDC_URI
              value: "https://authentik.henryathome.home64.de/application/o/photoprism/"
            - name: PHOTOPRISM_OIDC_CLIENT
              value: "UL29po2otoaH2mioipq9cekGkFSUvX6hTywaRsZ6"
            - name: PHOTOPRISM_OIDC_SECRET
              value: "Dx1FXPuFMtDFliZaZbpCOnlYvJYsFiBW533IyeRVdsT4y6XIAsHKVtLFYBijLXVQElu0UqoGOF1JJ8E2Gy3v97chQf6kXBQ5T2UMOXeFWSUlzhXVbNTFGwhITqPizycv"
            - name: PHOTOPRISM_OIDC_PROVIDER
              value: authentik
            - name: PHOTOPRISM_OIDC_REDIRECT
              value: "true"
            - name: PHOTOPRISM_OIDC_REGISTER
              value: "true"
            - name: PHOTOPRISM_OIDC_ICON
              value: "/static/img/oidc.svg"
            - name: PHOTOPRISM_OIDC_USERNAME
              value: "email"
          resources:
          #   requests:
          #     cpu: "100m"
          #     memory: "128Mi"
          #   limits:
          #     cpu: "500m"
          #     memory: "512Mi"
          volumeMounts:
            - mountPath: /photoprism/
              name: photoprism-library-pvc
#            - mountPath: /photoprism/storage
#              name: photoprism-storage
#            - mountPath: /photoprism/originals
#              name: photoprism-storage
#              name: photoprism-originals
#          securityContext:
#            runAsUser: 1000
#            runAsGroup: 1000
      volumes:
        - name: photoprism-library-pvc
          persistentVolumeClaim:
            claimName: photoprism-library-pvc
#        - name: photoprism-originals
#          persistentVolumeClaim:
#            claimName: photoprism-originals
---
apiVersion: v1
kind: Service
metadata:
  name: photoprism
  namespace: photoprism
spec:
  type: NodePort
  selector:
    app: photoprism
  ports:
    - port: 2342

