apiVersion: apps/v1
kind: Deployment
metadata:
  name: metabolic-ninja-legacy
spec:
  selector:
    matchLabels:
      app: metabolic-ninja
      env: legacy
  replicas: 1
  template:
    metadata:
      labels:
        app: metabolic-ninja
        env: legacy
    spec:
      containers:
      - name: web
        image: gcr.io/dd-decaf-cfbf6/metabolic-ninja-legacy:master
        imagePullPolicy: Always
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /pathways/healthz
            port: 8000
          initialDelaySeconds: 5
        env:
        - name: ENVIRONMENT
          value: production
        - name: MONGO_ADDR
          value: localhost
        - name: MONGO_PORT
          value: "27017"
        - name: ID_MAPPER_API
          value: http://id-mapper-production/idmapping/query
        - name: SENTRY_DSN
          valueFrom:
            secretKeyRef:
              name: metabolic-ninja-legacy
              key: SENTRY_DSN
        command: ["sh"]
        args: ["-c", "python src/tools/fill_lists.py && gunicorn -c gunicorn.py metabolic_ninja.app:app"]
        resources:
          requests:
            cpu: "0"
      - name: mongo
        image: mongo:latest
        ports:
        - containerPort: 27017
        resources:
          requests:
            cpu: "0"
