From 1d1c246aadb043955f54eb003b65f00bc45bcc98 Mon Sep 17 00:00:00 2001 From: Michael Balsillie Date: Wed, 29 Mar 2023 01:55:30 +0200 Subject: [PATCH] add build script and php edits --- Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ Dockerfile.nextcloud-fpm | 9 --------- build.sh | 10 ++++++++++ 3 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 Dockerfile delete mode 100644 Dockerfile.nextcloud-fpm create mode 100755 build.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2180d8c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +# Base image +ARG NEXTCLOUD_VER +FROM nextcloud:${NEXTCLOUD_VER}-fpm + +# Install extra utilities + +RUN apt update && \ + apt install -y --no-install-recommends \ + sudo \ + nano \ + nfs-common \ + libreoffice \ + libreoffice-java-common \ + default-jre \ + imagemagick \ + ghostscript \ + smbclient \ + iputils-ping \ + ffmpeg \ + procps \ + supervisor && \ + rm -rf /var/lib/apt/lists/* && \ + mkdir -p /var/log/supervisord /var/run/supervisord + +# Add supervisord and ImageMagick configuration + +COPY supervisord.conf / +COPY policy.xml /etc/ImageMagick-6/policy.xml + +# Set custom php configuration + +RUN echo "redis.session.locking_enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-redis.ini && \ + echo "redis.session.lock_retries=-1" >> /usr/local/etc/php/conf.d/docker-php-ext-redis.ini && \ + echo "redis.session.lock_wait_time=10000" >> /usr/local/etc/php/conf.d/docker-php-ext-redis.ini && \ + echo "session.gc_maxlifetime=86400" >> /usr/local/etc/php/conf.d/nextcloud.ini + +ENV NEXTCLOUD_UPDATE=1 +CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] + diff --git a/Dockerfile.nextcloud-fpm b/Dockerfile.nextcloud-fpm deleted file mode 100644 index fcf830a..0000000 --- a/Dockerfile.nextcloud-fpm +++ /dev/null @@ -1,9 +0,0 @@ -FROM nextcloud:stable-fpm -RUN apt update && apt install -y --no-install-recommends sudo nfs-common libreoffice libreoffice-java-common default-jre imagemagick ghostscript smbclient iputils-ping ffmpeg procps supervisor -RUN rm -rf /var/lib/apt/lists/* -RUN mkdir -p /var/log/supervisord /var/run/supervisord -COPY supervisord.conf / -COPY policy.xml /etc/ImageMagick-6/policy.xml -ENV NEXTCLOUD_UPDATE=1 -CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] - diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..ee3bcd7 --- /dev/null +++ b/build.sh @@ -0,0 +1,10 @@ +#!/bin/bash +DATE_TAG=$(date +%Y)-$(date +%m)-$(date +%d)_$(date +%H)-$(date +%M)-$(date +%S) +NEXTCLOUD_VER="24" +REGISTRY="code.balsillie.net" +ORG="containers" +IMAGE="nextcloud-supervisord" +IMAGE_FULL="$REGISTRY/$ORG/$IMAGE" +docker build --pull -f ./Dockerfile --build-arg NEXTCLOUD_VER=$NEXTCLOUD_VER -t "$IMAGE_FULL:$NEXTCLOUD_VER" -t "$IMAGE_FULL:$DATE_TAG" . +docker push -a "$IMAGE_FULL" +