apiVersion: apps/v1
kind: Deployment

metadata:
  name: danbooru-cron
  namespace: danbooru
  labels:
    app: danbooru-cron

spec:
  replicas: 1

  selector:
    matchLabels:
      app: danbooru-cron

  template:
    metadata:
      labels:
        app: danbooru-cron

    spec:
      hostname: danbooru-cron

      containers:
      - name: danbooru
        image: ghcr.io/danbooru/danbooru:production
        imagePullPolicy: Always

        args: ["bin/rails", "danbooru:cron"]

        envFrom:
        - configMapRef:
            name: danbooru-config-env
        - secretRef:
            name: danbooru-secret-env

        volumeMounts:
        - name: danbooru-local-config
          mountPath: "/etc/danbooru"
          readOnly: true

      volumes:
      - name: danbooru-local-config
        secret:
          secretName: danbooru-local-config
