From d878dd8c70dae033da921dd417845c7f0a88baeb Mon Sep 17 00:00:00 2001 From: Ethan Paul Date: Wed, 10 Apr 2024 23:15:34 -0400 Subject: [PATCH] Add in-container nextcloud install This increases the size of the container image, but reduces the reliance on the external volume for loading application data. This couples the application code to the container image rather than to the container state. --- nginx/Dockerfile | 9 +++++++++ php-fpm/Dockerfile | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 6ad0d66..0ddc206 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -7,4 +7,13 @@ ENV NEXTCLOUD_MAX_UPLOAD_SIZE=512M ADD nginx.conf.template /nginx.conf.template ADD docker-entrypoint.sh /docker-entrypoint.sh +RUN mkdir --parents /var/www/html +WORKDIR /var/www/html + +RUN curl -sSLo latest.zip https://download.nextcloud.com/server/releases/latest.zip +RUN unzip latest.zip +RUN rm latest.zip +RUN chown -R root:root nextcloud/ +RUN chmod -R 0755 nextcloud/ + ENTRYPOINT ["sh", "-c", "/docker-entrypoint.sh"] diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 6db2d09..aacfbb2 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -64,6 +64,11 @@ COPY ./php.ini-production /usr/local/etc/php/php.ini # Set the working directory WORKDIR /var/www/html +RUN curl -sSLo latest.zip https://download.nextcloud.com/server/releases/latest.zip +RUN unzip latest.zip +RUN rm latest.zip +RUN chown -R www-data:www-data nextcloud/ + # Expose port 9000 for PHP-FPM # EXPOSE 9000