---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      volumes:
      - name: static-files-volume
        emptyDir: {}
      initContainers:
      - name: copy-static
        image: meine-stadt-transparent
        command:
          - cp
          - -r
          - /static
          - /static-files
        volumeMounts:
        - mountPath: /static-files
          name: static-files-volume
      containers:
      - name: nginx
        image: nginx:1.17-alpine
        volumeMounts:
        - mountPath: /usr/share/nginx/html
          name: static-files-volume
          subPath: static
        resources:
          limits:
            memory: 250Mi
            cpu: "1"
          requests:
            memory: 250Mi
            cpu: "500m"
