Fix a docker rebuild issue #88
Reference in New Issue
Block a user
Delete Branch "bugfix/docker-rebuild"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
I think someone forgot to commit their pnpm-lock on
devand I had to update it to get past thesvelte-checkpre-commit hook.I didn't create a ticket for this but I totally can if desired.
Hm, I think this broke
VITE_PLATFORM_LOGOand maybe other env vars. Need to re-evaluate the approach.@@ -1,24 +1,31 @@FROM node:20-slim# Stage 1: BuildI changed this to a two-stage docker build mostly because include .env in an image seems dangerous even if none of the env values are secrets at this time.
@@ -17,2 +20,2 @@if [[ $VITE_PLATFORM_LOGO =~ ^https://* ]]; thencurl $VITE_PLATFORM_LOGO > static/logo.pngif [[ $VITE_PLATFORM_LOGO =~ ^https:// ]]; thencurl -fSL "$VITE_PLATFORM_LOGO" -o static/logo.pngThe old curl command was failing silently for me so this one will fail the build if the logo URL exists but the logo cannot be fetched.
@@ -7,1 +7,4 @@fiif [ -f .env ]; thensource .envfiThis fixes an issue I had with setting the logo. You could configure the other vars in
.envbecause npx reads that automatically but the logo was being read here and wasn't respecting .env.Ok this cascaded into more changes than I wanted but I think I fixed a pre-existing bug with the logo download too. I have been shipping shipwreck.scuttle.works using this Dockerfile for a few days now on my
feature/23-voice-room/pocbranch and it seems to be working.mplorentz referenced this pull request2026-03-03 19:50:47 +00:00