apiVersion: apps/v1
kind: Deployment
metadata:
  name: cvat-nginx
  namespace: cvat
  labels:
    app: cvat-app
    tier: proxy
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: cvat-app
      tier: proxy
  template:
    metadata:
      labels:
        app: cvat-app
        tier: proxy
    spec:
      volumes:
        - name: cvat-nginx-conf
          configMap:
            name: cvat-nginx-conf
            items:
              - key: nginx.conf
                path: nginx.conf
              - key: mime.types
                path: mime.types
              - key: cvat.conf
                path: cvat.conf
        # - name: log
        #   emptyDir: {}   
      containers:
      - name: nginx
        image: 'nginx:stable-alpine'
        resources:
          limits:
            memory: 512Mi
            cpu: "1"
          requests:
            memory: 256Mi
            cpu: "0.2"        
        # command: ["/bin/sh","nginx", "-g", "daemon off;"]
        ports:
          - containerPort: 80
        volumeMounts:      
        - mountPath: /etc/nginx/ # mount nginx-conf volume to /etc/nginx
          name: cvat-nginx-conf
          # readOnly: true
          # subPath: nginx.conf
        # - mountPath: /var/log/nginx   
        #   name: log 
                      
      restartPolicy: Always
