#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: wallet-web
spec:
  replicas: 1
  selector:
    matchLabels:
      app: web
      group: wallet
      component: wallet-web
  template:
    metadata:
      labels:
        app: web
        group: wallet
        component: wallet-web
    spec:
      volumes:
        - name: nginx-config-template
          configMap:
            name: nginx-config-template
        - name: wallet-static-images
          configMap:
            name: wallet-static-images
      containers:
      - name: web
        envFrom:
          - configMapRef:
              name: web-env
          - secretRef:
              name: web-env-secret
        image: wallet-web:latest
        ports:
          - containerPort: 80
            protocol: TCP
            name: http-port
        livenessProbe:
          httpGet:
            path: /healthcheck
            port: http-port
          initialDelaySeconds: 30
          periodSeconds: 10
          failureThreshold: 5
        volumeMounts:
          - name: nginx-config-template
            mountPath: /etc/nginx/templates
            readOnly: true
          - name: wallet-static-images
            mountPath: /etc/static/images
            readOnly: true
