From f43f245e1d0967ed56401f1fe5780ee2de846074 Mon Sep 17 00:00:00 2001 From: zontreck Date: Fri, 8 Nov 2024 12:59:46 -0700 Subject: [PATCH] Add nextcloud image --- NextCloud/Dockerfile | 46 +++++++++++++++++++++++++++++++++++------ NextCloud/cron_task | 1 + NextCloud/default.conf | 16 ++++++++++++++ NextCloud/entrypoint.sh | 12 +++++++++++ NextCloud/upload.ini | 7 +++++++ build.sh | 0 6 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 NextCloud/cron_task create mode 100644 NextCloud/default.conf create mode 100644 NextCloud/entrypoint.sh create mode 100644 NextCloud/upload.ini mode change 100644 => 100755 build.sh diff --git a/NextCloud/Dockerfile b/NextCloud/Dockerfile index b519863..c28507c 100644 --- a/NextCloud/Dockerfile +++ b/NextCloud/Dockerfile @@ -1,17 +1,51 @@ +FROM debian:latest AS BUILDER + +RUN apt-get update && apt-get upgrade -y +RUN apt-get install -y zip unzip git curl wget + + +WORKDIR /var/www + +RUN git clone https://github.com/nextcloud/server html + +WORKDIR /var/www/html +RUN git checkout v30.0.2 +RUN git submodule update --init --recursive + +RUN rm -rf .git + + FROM git.zontreck.com/ariascreations/buildenvironments:debianbuild -RUN apt-get install -y apache2 apache2-utils php8.3 php8.3-gd php8.3-mysql php8.3-mbstring php8.3-xml +RUN apt-get install -y apache2 apache2-utils php8.2 php8.2-gd php8.2-mysql php8.2-mbstring php8.2-xml php8.2-imagick imagemagick unzip zip php8.2-zip php8.2-curl php8.2-sqlite rsync + +RUN apt-get install -y php8.2-bcmath php8.2-gmp php8.2-intl cron ENV MOUNTPOINT /var/www/html ENV NEXTCLOUD_VERSION 30.0.2 -WORKDIR /var/www/html -RUN rm index.html +WORKDIR /var/www/ -RUN curl -sO "https://github.com/nextcloud/server/archive/refs/tags/v${NEXTCLOUD_VERSION}.tar.gz" -RUN tar -xvf "v${NEXTCLOUD_VERSION}.tar.gz" +COPY --from=BUILDER /var/www/html /var/www/htmlx + +WORKDIR /var/www/htmlx + +RUN chown -R www-data:www-data /var/www/htmlx +COPY ./upload.ini /etc/php/8.2/apache2/conf.d/upload.ini + +WORKDIR /etc/apache2/sites-enabled +RUN rm -f * +ADD ./default.conf ./default.conf + +WORKDIR /var/www/htmlx + +ADD ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ADD ./cron_task /etc/crontab EXPOSE 80 -CMD ["apache2ctl", "-D", "FOREGROUND"] \ No newline at end of file +CMD [ "crontab", "/etc/crontab" ] +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/NextCloud/cron_task b/NextCloud/cron_task new file mode 100644 index 0000000..90be223 --- /dev/null +++ b/NextCloud/cron_task @@ -0,0 +1 @@ +*/5 * * * * www-data php /var/www/html/cron.php > /dev/null 2>&1 diff --git a/NextCloud/default.conf b/NextCloud/default.conf new file mode 100644 index 0000000..bc44292 --- /dev/null +++ b/NextCloud/default.conf @@ -0,0 +1,16 @@ + + + DocumentRoot /var/www/html + + + AllowOverride All + Order deny,allow + Require all granted + + + # Disable HTTP TRACE method. + TraceEnable off + + Require all denied + + \ No newline at end of file diff --git a/NextCloud/entrypoint.sh b/NextCloud/entrypoint.sh new file mode 100644 index 0000000..3726515 --- /dev/null +++ b/NextCloud/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ -f /var/www/html/.fresh ] +then + rsync -a --progress -h --delete /var/www/htmlx/ /var/www/html/ +fi + +crontab /etc/crontab +service cron start + +chown -Rv www-data:www-data /var/www/html +apache2ctl -D FOREGROUND \ No newline at end of file diff --git a/NextCloud/upload.ini b/NextCloud/upload.ini new file mode 100644 index 0000000..106ade2 --- /dev/null +++ b/NextCloud/upload.ini @@ -0,0 +1,7 @@ +file_uploads = On +memory_limit = 512M +upload_max_filesize = 200G +post_max_size = 200G +max_execution_time = 600 + +opcache.interned_strings_buffer = 16 \ No newline at end of file diff --git a/build.sh b/build.sh old mode 100644 new mode 100755