---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: letterpad-demo
  labels:
    app: letterpad-demo
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
  selector:
    matchLabels:
      app: letterpad-demo
  template:
    metadata:
      labels:
        app: letterpad-demo
    spec:
      containers:
        - name: letterpad-demo-container
          image: gcr.io/ajaxtown-hosting/letterpad-demo:$GITHUB_SHA
          ports:
            - containerPort: 4040
          env:
            - name: ROOT_URL
              value: http://ajaxtown.com
            - name: BASE_NAME
              value: "/kube"
          volumeMounts:
            - mountPath: /letterpad/data
              name: sqlite-data
      volumes:
        - name: sqlite-data
          persistentVolumeClaim:
            claimName: letterpad-demo
