apiVersion: apps/v1
kind: Deployment
metadata:
  name: backend
  labels:
    app: minicms
spec:
  selector:
    matchLabels:
      app: minicms
  template:
    metadata:
      labels:
        app: minicms
    spec:
      containers:
      - name: mongo
        image: mongo
        command:
          - "mongod"
          - "--dbpath"
          - "/data/db"
        ports:
          - containerPort: 27017
        volumeMounts:
          - mountPath: /data/db
            name: minicms-storage
            subPath: minicms-mongo
      - name: simple-rest
        image: simple-rest:1.0.0
        ports:
        - containerPort: 9090
        imagePullPolicy: Never
      volumes:
        - name: minicms-storage
          persistentVolumeClaim:
              claimName: minicms-storage
