[wgo-web/nginx] Add entrypoint for updating Wordpress on start



commit 511c7e2051bca0368518948a9044062e45554bf6
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Wed Dec 16 09:49:32 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 42fa87d..412bc30 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -25,6 +25,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 = 4/' /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]