From f7160ea0005421662e7f329d7073d3cd86a5f7da Mon Sep 17 00:00:00 2001
From: Santosh <santhosht@baylogictech.com>
Date: Fri, 12 Jul 2019 18:21:44 +0530
Subject: [PATCH] Fixes #9 added yaml file to deploy dotcms along with
 postgreSQL

---
 openshift/dotCMS-OpenShift.yaml | 127 ++++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)
 create mode 100644 openshift/dotCMS-OpenShift.yaml

diff --git a/openshift/dotCMS-OpenShift.yaml b/openshift/dotCMS-OpenShift.yaml
new file mode 100644
index 0000000..e337778
--- /dev/null
+++ b/openshift/dotCMS-OpenShift.yaml
@@ -0,0 +1,127 @@
+apiVersion: v1
+kind: List
+items:
+- apiVersion: v1
+  kind: PersistentVolumeClaim
+  metadata:
+    name: cms-shared-pvc
+  spec:
+    accessModes:
+    - ReadWriteMany
+    storageClassName: ""
+    resources:
+      requests:
+        storage: 5Gi
+- apiVersion: v1
+  kind: PersistentVolumeClaim
+  metadata:
+    name: dbdata-pvc
+  spec:
+    accessModes:
+    - ReadWriteOnce
+    storageClassName: ""
+    resources:
+      requests:
+        storage: 10Gi
+- apiVersion: extensions/v1beta1
+  kind: Deployment
+  metadata:
+    name: postgres
+  spec:
+    replicas: 1
+    selector:
+      matchLabels:
+        app: postgres
+    template:
+      metadata:
+        labels:
+          app: postgres
+      spec:
+        volumes:
+        - name: dbdata
+          persistentVolumeClaim:
+            claimName: dbdata-pvc
+        containers:
+        - name: postgres
+          image: bitnami/postgres:9.6
+          imagePullPolicy: Always
+          ports:
+          - containerPort: 5432
+            protocol: TCP
+          env:
+          - name: POSTGRESQL_USERNAME
+            value: dotcmsdbuser
+          - name: POSTGRESQL_PASSWORD
+            value: password
+          - name: POSTGRESQL_DATABASE
+            value: dotcms   
+          volumeMounts:
+          - name: dbdata
+            mountPath: /data/pg
+        restartPolicy: Always
+- apiVersion: v1
+  kind: Service
+  metadata:
+    name: db-svc
+  spec:
+    ports:
+    - port: 5432
+    selector:
+      app: postgres
+    type: ClusterIP        
+- apiVersion: extensions/v1beta1
+  kind: Deployment
+  metadata:
+    name: dotcms
+  spec:
+    replicas: 1
+    selector:
+      matchLabels:
+        app: dotcms
+    template:
+      metadata:
+        labels:
+          app: dotcms
+      spec:
+        volumes:
+        - name: cmsshared
+          persistentVolumeClaim:
+            claimName: cms-shared-pvc        
+        containers:
+        - name: dotcms
+          image: <dotcms-image>
+          imagePullPolicy: Always
+          ports:
+            - containerPort: 4000
+              protocol: TCP
+            - containerPort: 8000
+              protocol: TCP
+            - containerPort: 8080
+              protocol: TCP
+            - containerPort: 8081
+              protocol: TCP
+            - containerPort: 8082
+              protocol: TCP
+          env:
+          - name: CMS_HEAP_SIZE
+            value: 2G
+          - name: CMS_JAVA_OPTS
+            value: -XX:+PrintFlagsFinal
+          - name: PROVIDER_DB_DNSNAME
+            value: db-svc
+          volumeMounts:
+          - name: cmsshared
+            mountPath: /data/shared
+        restartPolicy: Always
+- apiVersion: v1
+  kind: Service
+  metadata:
+    name: dotcms
+  spec:
+    ports:
+    - name: dotcms
+      port: 8080
+      protocol: TCP
+    selector:
+      app: dotcms
+    type: ClusterIP
\ No newline at end of file