apiVersion: v1
kind: Pod
metadata:
  name: django-env
spec:
  containers:
  - name: django-nginx
    image: quay.io/sotolitolabs/django-rest-nginx:latest
    ports:
    - containerPort: 80
      hostPort: 8081
    volumeMounts:
    - name: nginx
      mountPath: /usr/share/nginx/html
  - name: django-postgres
    image: quay.io/sotolitolabs/django-postgresql:latest
    ports:
    - containerPort: 5432
    env:
    - name: DJANGO_DB
      value: test_db 
    - name: DJANGO_DB_USER 
      value: test_user 
    - name: DJANGO_PASSWORD
      value: test123
    - name: POSTGRES_PASSWORD
      value: test123 
    volumeMounts:
    - name: postgres
      mountPath: /var/lib/postgresql/data
  - name: django-rest
    image: quay.io/sotolitolabs/django-rest:latest
    command: ["/code/sm/manage.py"]
    args: ["runserver"]
    ports:
    - containerPort: 8000
    volumeMounts:
    - name: code
      mountPath: /code
  volumes:
  - name: nginx
    hostPath:
      path: /home/sotolito/sm/django-nginx/html
      type: Directory
  - name: postgres
    hostPath:
      path: /home/sotolito/sm/django-postgres/
      type: Directory
  - name: code
    hostPath:
      path: /home/sotolito/sm/django-rest/
      type: Directory





