apiVersion: apps/v1
kind: Deployment
metadata:
  name: backend-onboarding
  labels:
    app: backend-onboarding
spec:
  replicas: 1
  selector:
    matchLabels:
      app: backend-onboarding
  template:
    metadata:
      name: backend-onboarding
      labels:
        app: backend-onboarding
    spec:
      initContainers:
        - name: init-backend-onboarding
          image: CONTAINER_IMAGE
          envFrom:
            - configMapRef:
                name: backend-onboarding
          imagePullPolicy: "Always"
          command: ["sh", "-c", "npm run migrate"]
      containers:
        - name: backend-onboarding
          image: CONTAINER_IMAGE
          envFrom:
            - configMapRef:
                name: backend-onboarding
          imagePullPolicy: "Always"
          ports:
            - containerPort: 3000
