From d5470101f40d604ea21b14a21bcf246b42669aec Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Wed, 6 Mar 2024 21:25:02 +0000 Subject: [PATCH] don't build the frontend by default in Docker --- .env.docker | 7 +++++++ Dockerfile | 23 ++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.env.docker b/.env.docker index 0d5836745..e90ac1c03 100644 --- a/.env.docker +++ b/.env.docker @@ -1122,6 +1122,13 @@ DOCKER_APP_HOST_CACHE_PATH="${DOCKER_ALL_HOST_DATA_ROOT_PATH:?error}/pixelfed/ca # @dottie/validate required,oneof=0 1 2 #DOCKER_APP_PHP_OPCACHE_REVALIDATE_FREQ="2" +# When doing [docker compose build], should the frontend be built in the Dockerfile? +# If set to "0" the included pre-compiled frontend will be used. +# +# @default "0" +# @dottie/validate required,oneof=0 1 +#DOCKER_APP_BUILD_FRONTEND="0" + ################################################################################ # docker redis ################################################################################ diff --git a/Dockerfile b/Dockerfile index da1f8d5ee..599e450b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -188,6 +188,7 @@ RUN --mount=type=cache,id=pixelfed-pear-${PHP_VERSION}-${PHP_DEBIAN_RELEASE}-${T FROM --platform=${BUILDARCH} node:lts AS frontend-build ARG BUILDARCH +ARG BUILD_FRONTEND=0 ARG RUNTIME_UID ARG NODE_ENV=production @@ -199,16 +200,28 @@ WORKDIR /var/www/ RUN --mount=type=cache,id=pixelfed-node-${BUILDARCH},sharing=locked,target=/tmp/cache \ --mount=type=bind,source=package.json,target=/var/www/package.json \ --mount=type=bind,source=package-lock.json,target=/var/www/package-lock.json \ - npm install \ - --cache /tmp/cache \ - --no-save \ - --dev + <