|
@@ -41,6 +41,15 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
# Copy backend
|
|
# Copy backend
|
|
|
COPY backend/ ./backend/
|
|
COPY backend/ ./backend/
|
|
|
|
|
|
|
|
|
|
+# Capture the current git branch at build time. `.git/HEAD` is the only
|
|
|
|
|
+# .git metadata the build context lets through (see .dockerignore); it
|
|
|
|
|
+# contains `ref: refs/heads/<branch>`, which the SpoolBuddy remote-update
|
|
|
|
|
+# flow reads at runtime via detect_current_branch() in spoolbuddy_ssh.py.
|
|
|
|
|
+# Without this, the production image has no git metadata at all and would
|
|
|
|
|
+# always pull `main` on the remote device regardless of which branch
|
|
|
|
|
+# Bambuddy itself was built from.
|
|
|
|
|
+COPY .git/HEAD ./.git/HEAD
|
|
|
|
|
+
|
|
|
# Copy built frontend from builder stage
|
|
# Copy built frontend from builder stage
|
|
|
COPY --from=frontend-builder /app/static ./static
|
|
COPY --from=frontend-builder /app/static ./static
|
|
|
|
|
|