From bc145f4caf838c1788195f5a8e483d475881d72f Mon Sep 17 00:00:00 2001 From: Matt Lorentz Date: Tue, 3 Mar 2026 19:52:22 +0000 Subject: [PATCH] Fix a docker rebuild issue (#88) The Docker build wasn't making use of docker's cache because the .git directory was being copied into the build context. This means that even if the app did not change, if anything in git changed then docker would rebuild the entire app. This excludes the .git folder from the docker build, instead relying on the user to pass in the build hash at build time. Which is annoying but I don't think there's a better way around it. This was annoying me because I am deploying a self-hosted version of flotilla from a git branch via ansible and it was rebuilding flotilla every time. Co-authored-by: mplorentz Reviewed-on: https://gitea.coracle.social/coracle/flotilla/pulls/88 Co-authored-by: Matt Lorentz Co-committed-by: Matt Lorentz --- Dockerfile | 1 + build.sh | 4 ++-- pnpm-lock.yaml | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 18f909db..1d62f67d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ ENV VITE_BUILD_HASH=${VITE_BUILD_HASH} ENV NODE_OPTIONS=--max_old_space_size=16384 RUN pnpm run build +# Stage 2: Runtime FROM node:20-alpine WORKDIR /app diff --git a/build.sh b/build.sh index dc48ea9d..1b632f25 100755 --- a/build.sh +++ b/build.sh @@ -5,8 +5,8 @@ temp_env=$(declare -p -x) if [ -f .env.template ]; then source .env.template fi -if [ -f .env.local ]; then - source .env.local +if [ -f .env ]; then + source .env fi # Avoid overwriting env vars provided directly diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c48e9fa4..028a3ad2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3510,6 +3510,10 @@ packages: resolution: {integrity: sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==} hasBin: true + markdown-it@14.1.1: + resolution: {integrity: sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==} + hasBin: true + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} @@ -8665,6 +8669,15 @@ snapshots: markdown-it-task-lists@2.1.1: {} + markdown-it@14.1.1: + dependencies: + argparse: 2.0.1 + entities: 4.5.0 + linkify-it: 5.0.0 + mdurl: 2.0.0 + punycode.js: 2.3.1 + uc.micro: 2.1.0 + markdown-it@14.1.1: dependencies: argparse: 2.0.1