apiVersion: apps/v1
kind: Deployment
metadata:
  name: zendphp
  labels:
    where: backyard
spec:
  replicas: 2
  selector:
    matchLabels:
      app: zendphp
      where: backyard
  template:
    metadata:
      labels:
        app: zendphp
        where: backyard
    spec:
      containers:
        - name: zendphp
          image: rbasayev/zendphp:latest
          command:
            - entry_fpm.sh
          #args: ["--drop2web", "# causes permission issue :(, need to fix"]
          volumeMounts:
            - name: adminer-pv
              mountPath: /var/www/site
      volumes:
        - name: adminer-pv
          persistentVolumeClaim:
            claimName: pvc-docroot
      initContainers:
        - name: get-adminer
          image: busybox
          volumeMounts:
            - name: adminer-pv
              mountPath: /Downloads
          command:
            - wget
            - "-O"
            - "/Downloads/index.php"
            - "https://github.com/vrana/adminer/releases/download/v4.8.0/adminer-4.8.0-en.php"

