diff --git a/wordpress.yaml b/wordpress.yaml index 6f48d41..41c9b01 100644 --- a/wordpress.yaml +++ b/wordpress.yaml @@ -13,6 +13,20 @@ spec: labels: app: wordpress spec: + initContainers: + - name: init-pg4wp + image: hub.hamdocker.ir/library/busybox:latest + command: + - sh + - -c + - | + wget -O /tmp/pg4wp.zip https://github.com/kevinoid/postgresql-for-wordpress/archive/refs/heads/master.zip + unzip /tmp/pg4wp.zip -d /var/www/html/wp-content/plugins/ + mv /var/www/html/wp-content/plugins/postgresql-for-wordpress-master /var/www/html/wp-content/plugins/pg4wp + cp /var/www/html/wp-content/plugins/pg4wp/db.php /var/www/html/wp-content/db.php + volumeMounts: + - name: wordpress-data + mountPath: /var/www/html containers: - name: wordpress image: wordpress:latest @@ -27,6 +41,12 @@ spec: value: "wordpress" ports: - containerPort: 80 + volumeMounts: + - name: wordpress-data + mountPath: /var/www/html + volumes: + - name: wordpress-data + emptyDir: {} --- apiVersion: v1 kind: Service