From 0ecb3ed960c66f30d83008db4b2d3fa5b79028e8 Mon Sep 17 00:00:00 2001 From: Kovah Date: Sun, 30 Oct 2022 16:34:54 +0100 Subject: [PATCH] Optimize build process, add Horizon publishing --- .github/workflows/build-docker.yml | 2 ++ contrib/docker/Dockerfile.apache | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 9413a4e7f..e7f96f001 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -35,3 +35,5 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: kovah/pixelfed-docker:latest + cache-from: type=registry,ref=user/app:latest + cache-to: type=inline diff --git a/contrib/docker/Dockerfile.apache b/contrib/docker/Dockerfile.apache index c4d5c305b..c0e8ca036 100644 --- a/contrib/docker/Dockerfile.apache +++ b/contrib/docker/Dockerfile.apache @@ -4,9 +4,6 @@ ENV COMPOSER_MEMORY_LIMIT=-1 ARG DEBIAN_FRONTEND=noninteractive WORKDIR /var/www/ -# Use the default production configuration -COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini" - # Get Composer binary COPY --from=composer:latest /usr/bin/composer /usr/bin/composer @@ -86,12 +83,18 @@ RUN apt-get update \ && rm -rf /var/cache/apt \ && rm -rf /var/lib/apt/lists/ +# Use the default production configuration +COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini" + COPY . /var/www/ # for detail why storage is copied this way, pls refer to https://github.com/pixelfed/pixelfed/pull/2137#discussion_r434468862 RUN cp -r storage storage.skel \ && composer install --prefer-dist --no-interaction --no-ansi --optimize-autoloader \ && rm -rf html && ln -s public html \ && chown -R www-data:www-data /var/www + +RUN php artisan horizon:publish + VOLUME /var/www/storage /var/www/bootstrap CMD ["/var/www/contrib/docker/start.apache.sh"]