apiVersion: v1
kind: Pod
metadata:
  name: web-app-init
spec:
  initContainers:
  - name: init-sync-ctr
    image: k8smaestro/git:2.11.1
    volumeMounts:
    - mountPath: /var/lib/data
      name: git 
    command:
    - "sh"
    - "-c"
    - "git clone $(GIT_REPO) . && git pull"
    workingDir: /var/lib/data
    env:
    - name: GIT_REPO
      value: https://github.com/dnaprawa/beginner-html-site-scripted
  containers:
  - name: app
    image: httpd:2.4.47
    ports:
    - containerPort: 80
    volumeMounts:
    - mountPath: /usr/local/apache2/htdocs
      name: git ## the same volume
  volumes:
  - emptyDir: {}
    name: git