apiVersion: apps/v1
kind: Deployment
metadata:
  name: php
  labels:
    tier: backend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: php
      tier: backend
  template:
    metadata:
      labels:
        app: php
        tier: backend
    spec:
      terminationGracePeriodSeconds: 30
      volumes:
      - name: dir
        hostPath:
          path: /code
      containers:
      - name: php
        image: 042002498327.dkr.ecr.eu-north-1.amazonaws.com/spark_php:{{ .Values.tags }}
        volumeMounts:
        - name: dir
          mountPath: /code
      initContainers:
      - name: install
        image: 042002498327.dkr.ecr.eu-north-1.amazonaws.com/spark_php:v1
        args :
        - /bin/bash
        - -c
        - cp -rp /var/www/html/. /code/app/
        volumeMounts:
        - name: dir
          mountPath: /code
