apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-frontend
  labels:
    app: test-frontend
    tier: frontend
spec:
  replicas: 1
  minReadySeconds: 15
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 50%
  selector:
    matchLabels:
      app: test-frontend
      tier: frontend
  template:
    metadata:
      labels:
        app: test-frontend
        tier: frontend
    spec:
      containers:
        - name: app
          image: test-frontend:dev
          imagePullPolicy: Never
          resources:
            limits:
              cpu: "100m"
              memory: "256Mi"
            requests:
              cpu: "1m"
              memory: "10Mi"
          command: ["npm", "run", "start"]
          volumeMounts:
            - name: host-mount
              mountPath: /app/src
          ports:
            - containerPort: 3000
          env:
            - name: NODE_ENV
              value: 'production'
      volumes:
        - name: host-mount
          hostPath:
            path: /test-frontend/src
