add build script and php edits

This commit is contained in:
Michael Balsillie 2023-03-29 01:55:30 +02:00
parent ddff93393d
commit 1d1c246aad
3 changed files with 49 additions and 9 deletions

39
Dockerfile Normal file
View File

@ -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"]

View File

@ -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"]

10
build.sh Executable file
View File

@ -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"