---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: php-apache
  name: php-apache
  namespace: vbulletin
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: php-apache
  template:
    metadata:
      labels:
        app: php-apache
    spec:
      initContainers:
      - name: install-php-curl
        image: php:8-apache
        command:
          - docker-php-ext-install
          - curl
        volumeMounts:
          - name: vbulletin
            mountPath: /var/www/html
      - name: install-php-argon2
        image: php:8-apache
        command:
          - docker-php-ext-install
          - argon2
        volumeMounts:
          - name: vbulletin
            mountPath: /var/www/html
      - name: install-php-mbxtring
        image: php:8-apache
        command:
          - docker-php-ext-install
          - gd
        volumeMounts:
          - name: vbulletin
            mountPath: /var/www/html
      - name: install-php-gd
        image: php:8-apache
        command:
          - docker-php-ext-install
          - gd
        volumeMounts:
          - name: vbulletin
            mountPath: /var/www/html
      - name: install-php-hash
        image: php:8-apache
        command:
          - docker-php-ext-install
          - hash
        volumeMounts:
          - name: vbulletin
            mountPath: /var/www/html
      - name: install-php-json
        image: php:8-apache
        command:
          - docker-php-ext-install
          - json
        volumeMounts:
          - name: vbulletin
            mountPath: /var/www/html
      - name: install-php-xml
        image: php:8-apache
        command:
          - docker-php-ext-install
          - xml
      - name: install-php-mysqli
        image: php:8-apache
        command:
          - docker-php-ext-install
          - mysqli
        volumeMounts:
          - name: vbulletin
            mountPath: /var/www/html
      containers:
        - env:
          - name: DATABASE
            value: vbsuite
          - name: DBUSER
            value: root
          - name: DBPASSWORD
            valueFrom:
              secretKeyRef:
                key: 'mariadb-root-password'
                name: 'vbulletin'
          - name: PORT
            value: '80'
          image: php:8-apache
          imagePullPolicy: IfNotPresent
          name: php-apache
          resources:
            limits:
              cpu: 1000m
              memory: 1Gi
            requests:
              cpu: 500m
              memory: 500m
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - name: vbulletin
              mountPath: /var/www/html
              subPath: html
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      terminationGracePeriodSeconds: 30
      volumes:
       - name: vbulletin
         persistentVolumeClaim:
           claimName: vbulletin
           readOnly: false