[wgo2-web/oscp] Abuse entrypoint to run the latest code and database migrations



commit c92f51802206b112313249e9728a8f82695ae527
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Thu Mar 4 11:00:46 2021 +0100

    Abuse entrypoint to run the latest code and database migrations

 Dockerfile | 9 ++++++++-
 entrypoint | 6 ++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/Dockerfile b/Dockerfile
index 3e51f66..8e67a42 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -11,12 +11,19 @@ RUN apt-get update && apt-get install -y libldap-2.4-2 libldap2-dev && \
 ADD ipa-ca.crt /etc/ipa-ca.crt
 ADD ldap.conf /etc/ldap/ldap.conf
 
+RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
+    chmod +x wp-cli.phar && \
+    mv wp-cli.phar /usr/local/bin/wp
+
 RUN echo no | pecl install apcu && \
     docker-php-ext-enable apcu && \
     echo 'apc.enable=1' > /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
 
 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..9d5f978
--- /dev/null
+++ b/entrypoint
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+docker-entrypoint.sh apache2
+wp core update-db
+
+exec php-fpm


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