apiVersion: apps/v1
kind: Deployment
metadata:
  name: cryptowallet-server-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      app: cryptowallet-server
      name: app-pod
  template:
    metadata:
      labels:
        app: cryptowallet-server
        name: app-pod
    spec:
      containers:
        - name: cryptowallet-server
          image: gcr.io/cryptowallet-261720/cryptowallet-server
          lifecycle:
            postStart:
              exec:
                command: ["npm", "run", "migrate"]
          envFrom:
            - secretRef:
                name: app-secrets
            - secretRef:
                name: db-config
            - configMapRef:
                name: app-config
          ports:
            - containerPort: 3000
