apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
  namespace: bsc-internal
  labels:
    app: api
spec:
  selector:
    matchLabels:
      app: api
  template:
    metadata:
      labels:
        app: api
    spec:
      containers:
        - name: api
          image: SELECTED_REPOSITORY_DOCKER_IMAGE_URL
          volumeMounts:
            - name: generator-model
              mountPath: "/usr/application/app/input_generator_model/input_model.bin"
            - name: scorer-model
              mountPath: "/usr/application/app/input_scorer_model"
          ports:
            - containerPort: 8000
              name: api
      initContainers:
        - name: api-initialization
          image: SELECTED_REPOSITORY_DOCKER_IMAGE_URL
          command: ["python3", "manage.py", "migrate"]
      volumes:
        - name: generator-model
          persistentVolumeClaim:
            claimName: generator-model
      volumes:
        - name: scorer-model
          persistentVolumeClaim:
            claimName: scorer-model
