From 5466e98fb4aa8b06767c7f4dd48e006211c63ce2 Mon Sep 17 00:00:00 2001 From: adphi Date: Wed, 9 May 2018 11:49:26 +0200 Subject: [PATCH] Removed MYSQL_ROOT env vars after db initialization --- 13.0/fpm/Dockerfile | 7 ++++--- 13.0/fpm/config/autoconfig.php | 3 +++ 13.0/fpm/config/redis.config.php | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 13.0/fpm/config/redis.config.php diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index 18b695d..3a3219d 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -90,13 +90,13 @@ RUN { \ echo 'opcache.revalidate_freq=1'; \ } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ \ - mkdir /var/www/data; \ + mkdir /data; \ + chown -R www-data:root /data; \ chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html - ENV NEXTCLOUD_VERSION 13.0.2 RUN set -ex; \ @@ -118,6 +118,7 @@ RUN set -ex; \ COPY *.sh / COPY config/* /usr/src/nextcloud/config/ - +#HEALTHCHECK --interval=1s --timeout=3s --retries=16 \ +#CMD test $(ps ax | grep php-fpm | grep -v grep | wc -l) -gt 0 && echo okay ENTRYPOINT ["/entrypoint.sh"] CMD ["php-fpm"] diff --git a/13.0/fpm/config/autoconfig.php b/13.0/fpm/config/autoconfig.php index c62da8e..4a929d7 100644 --- a/13.0/fpm/config/autoconfig.php +++ b/13.0/fpm/config/autoconfig.php @@ -12,6 +12,9 @@ if (getenv('SQLITE_DATABASE')) { $password = getenv('MYSQL_PASSWORD'); $database = getenv('MYSQL_DATABASE'); $host = getenv('MYSQL_HOST'); + // Erase root environment variables + putenv('MYSQL_ROOT_USER'); + putenv('MYSQL_ROOT_PASSWORD'); // Create connection $connection = new mysqli($host, $root_user, $root_password); // Check connection diff --git a/13.0/fpm/config/redis.config.php b/13.0/fpm/config/redis.config.php new file mode 100644 index 0000000..b0cebe3 --- /dev/null +++ b/13.0/fpm/config/redis.config.php @@ -0,0 +1,8 @@ + '\OC\Memcache\Redis', + 'redis' => array( + 'host' => 'redis', + 'port' => 6379, + ), +);