diff --git a/.drone.yml b/.drone.yml index 0ac15a2..a947b97 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,8 @@ steps: from_secret: DOCKERHUB_USERNAME password: from_secret: DOCKERHUB_PASSWORD - cache_from: "glenux/service-nextcloud:latest_${DRONE_BRANCH/\\//-}" + cache_from: + - "glenux/service-nextcloud:${DRONE_BRANCH/\\//-}_latest" repo: glenux/service-nextcloud tags: "${DRONE_COMMIT_SHA:0:8}" purge: false @@ -43,9 +44,9 @@ steps: from_secret: DOCKERHUB_PASSWORD cache_from: - "glenux/service-nextcloud:${DRONE_COMMIT_SHA:0:8}" - - "glenux/service-nextcloud:latest_${DRONE_BRANCH/\\//-}" + - "glenux/service-nextcloud:${DRONE_BRANCH/\\//-}_latest" repo: glenux/service-nextcloud - tags: "latest_${DRONE_BRANCH/\\//-}" + tags: "${DRONE_BRANCH/\\//-}_latest" purge: false when: branch: @@ -64,7 +65,7 @@ steps: from_secret: DOCKERHUB_PASSWORD cache_from: - "glenux/service-nextcloud:${DRONE_COMMIT_SHA:0:8}" - - "glenux/service-nextcloud:latest_${DRONE_BRANCH/\\//-}" + - "glenux/service-nextcloud:${DRONE_BRANCH/\\//-}_latest" repo: glenux/service-nextcloud tags: latest purge: false diff --git a/Dockerfile b/Dockerfile index e414e19..636a59b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,15 +17,19 @@ # FROM nextcloud:27.1.3-apache # FROM nextcloud:27.1.4-apache # FROM nextcloud:28.0.1-apache -FROM nextcloud:29.0.3-apache +# FROM nextcloud:29.0.3-apache +# FROM nextcloud:29.0.7-apache +FROM nextcloud:30.0.4-apache # This is a stupid comment for a demo (remove later) RUN apt-get update \ && apt-get install -y --no-install-recommends \ - clamdscan nano ghostscript jq \ + nano ghostscript \ && apt-get clean +# clamdscan + # ## Enable REDIS extension # RUN pecl channel-update pecl.php.net \ @@ -86,6 +90,11 @@ RUN echo '[opcache]' > /usr/local/etc/php/conf.d/opcache.ini \ && echo '[PHP]' > /usr/local/etc/php/conf.d/memory-limit.ini \ && echo 'memory_limit=1024M' >> /usr/local/etc/php/conf.d/memory-limit.ini +COPY php-uploads.ini /usr/local/etc/php/conf.d/glenux-uploads.ini +COPY php-performance.ini /usr/local/etc/php/conf.d/glenux-performance.ini +COPY php-errors.ini /usr/local/etc/php/conf.d/glenux-errors.ini +RUN echo "LimitRequestBody 0" > /etc/apache2/conf-enabled/nextcloud-fix-413-error.conf + ## ## CRON SETUP ## diff --git a/hooks/gx.before-starting.www.sh b/hooks/gx.before-starting.www.sh index 8a0f7b1..74d9b58 100755 --- a/hooks/gx.before-starting.www.sh +++ b/hooks/gx.before-starting.www.sh @@ -18,9 +18,10 @@ cd "$WORKDIR" || exit 1 echo "GX:BEFORE-STARTING:START ($(pwd))" # find . -maxdepth 1 echo "GX:BEFORE-STARTING:STATUS" -INSTALLED="$(php -d memory_limit=-1 occ status |jq -r '.installed')" -if [ "$INSTALLED" != "true" ]; then - echo "WARNING: Not installed yet. Exiting." +php -d memory_limit=-1 occ status +# INSTALLED="$(php -d memory_limit=-1 occ status |jq -r '.installed')" +if php -d memory_limit=-1 occ status 2>&1 | grep -q 'not installed' ; then + echo "WARNING: Nextcloud is not installed yet. Exiting." exit 0 fi diff --git a/php-errors.ini b/php-errors.ini new file mode 100644 index 0000000..db533d5 --- /dev/null +++ b/php-errors.ini @@ -0,0 +1,11 @@ +error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +log_errors = On + +## For production +# display_errors = Off +# error_log = /dev/stderr + +## For debugging +display_errors = On +error_log = /var/log/php-errors.log + diff --git a/php-performance.ini b/php-performance.ini new file mode 100644 index 0000000..c600a1a --- /dev/null +++ b/php-performance.ini @@ -0,0 +1,3 @@ +; Maximum amount of memory a script may consume (64MB) +memory_limit = 256M +max_input_vars = 3000 diff --git a/php-uploads.ini b/php-uploads.ini new file mode 100644 index 0000000..c60e710 --- /dev/null +++ b/php-uploads.ini @@ -0,0 +1,5 @@ +file_uploads = On +upload_max_filesize = 128M +post_max_size = 128M +max_execution_time = 1200 +max_input_time = 120