[store-web] Add entrypoint for updating Wordpress on start



commit 02cf1e0c3ef342c3be79b22512c1e013ec8b2b1d
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Wed Dec 16 09:50:45 2020 +0100

    Add entrypoint for updating Wordpress on start

 Dockerfile |  5 ++++-
 entrypoint | 13 +++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/Dockerfile b/Dockerfile
index 7d04da6..8e67a42 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,9 @@ RUN echo no | pecl install apcu && \
 
 RUN yes no | pecl install redis && \
     docker-php-ext-enable redis
-   
+
 ADD php.ini /usr/local/etc/php/conf.d/wordpress.ini
 RUN sed -i 's/pm.max_children =.*/pm.max_children = 8/' /usr/local/etc/php-fpm.d/www.conf
+
+ADD entrypoint /entrypoint
+ENTRYPOINT ["/entrypoint"]
diff --git a/entrypoint b/entrypoint
new file mode 100755
index 0000000..5f0375b
--- /dev/null
+++ b/entrypoint
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+WP="wp"
+
+IMAGE_VERSION="$WORDPRESS_VERSION"
+CURRENT_VERSION="$($WP core version)"
+
+if [[ "$CURRENT_VERSION" != "$IMAGE_VERSION" ]]; then
+    $WP core update 
+    $WP plugin update --all
+fi
+
+exec docker-entrypoint.sh php-fpm


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]