apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: ws
  name: ws
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ws
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: ws
    spec:
      containers:
        - name: ws
          image: bibxml/base
          imagePullPolicy: Never
          command: ["/bin/sh"]
          args: ["-c", "python manage.py collectstatic --noinput && python manage.py check --deploy && python manage.py runserver 0.0.0.0:8800"]
          env:
            - name: PRIMARY_HOSTNAME
              value: localhost
            - name: DEBUG
              value: "1"
            - name: DJANGO_SECRET
              valueFrom:
                secretKeyRef:
                  name: django-credentials
                  key: secret
            - name: DB_HOST
              value: db-service
            - name: DB_NAME
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: db
            - name: DB_PORT
              value: "5432"
            - name: DB_SECRET
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: password
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: user
            - name: REDIS_HOST
              value: redis-service
            - name: REDIS_PORT
              value: "6379"
          ports:
            - containerPort: 8800
          resources: {}
      restartPolicy: Always
status: {}
