apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: web
spec:
  selector:
    matchLabels:
      app: web
  replicas: 2 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: web
        image: django
        ports:
        - containerPort: 8000   
        env:
        - name: ALLOWED_HOSTS
          value: "localhost "
        - name: SECRET_KEY
          value: "abcd"
        - name: SENTRY_DSN
          value: ""
        - name: B_DATABASE_URL
          value: "postgres://postgres:@db:5432/postgres"
        - name: REDIS_URL
          value: "redis://redis:6379"
        - name: WAIT_FOR
          value: "db:5432,redis:6379"
        command: ["./run_dev_server.sh"]
