apiVersion: apps/v1
kind: Deployment
metadata:
  name: ml-github-app
  namespace: mlapp
  labels:
    app: ml-github-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: ml-github-app
  template:
    metadata:
      labels:
        app: ml-github-app
    spec:
      containers:
      - name: ml-github-app
        image: hamelsmu/mlapp
        command: ["python", "app.py"]
        readinessProbe:
          httpGet:
            path: /
            port: 3000
          initialDelaySeconds: 10
          periodSeconds: 3
        env:
        - name: PRIVATE_KEY
          valueFrom:
            secretKeyRef:
              name: ml-app-inference-secret
              key: PRIVATE_KEY
        - name: DATABASE_URL
          valueFrom:
            secretKeyRef:
              name: ml-app-inference-secret
              key: DATABASE_URL
        - name: WEBHOOK_SECRET
          valueFrom:
            secretKeyRef:
              name: ml-app-inference-secret
              key: WEBHOOK_SECRET
        - name: APP_ID
          valueFrom:
            secretKeyRef:
              name: ml-app-inference-secret
              key: APP_ID
        - name: FLASK_ENV
          value: production
        - name: PORT
          value: '3000'
        - name: APP_URL
          value: https://mlbot.net/
        - name: APP_URL_HEROKU
          value: https://fathomless-forest-27162.herokuapp.com/
        - name: authors
          value: e
        ports:
        - containerPort: 443
        - containerPort: 80
        - containerPort: 3000