From 68ccc25652422c4a582cf6dac58d54a36807e29f Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Fri, 18 Sep 2026 02:37:11 +0000 Subject: [PATCH] Trying to improve dockerfile cacheing --- .gitignore | 4 ++++ Dockerfile | 22 +++++++++---------- overlord/src/app/ledger/ledger.component.html | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 89fbbe6a..0657f0d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# Ignore Git metadata +.git +.gitignore + # IDEs & System Files .idea/ .DS_Store diff --git a/Dockerfile b/Dockerfile index f803e331..58090323 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ # builds (podman builds all --platform targets concurrently). # Declare the automatic build arguments ARG BUILDPLATFORM -FROM --platform=$BUILDPLATFORM node:lts-trixie-slim AS base +FROM --platform=$BUILDPLATFORM docker.io/library/node:lts-trixie-slim AS base # Install dependencies only when needed FROM base AS deps @@ -36,7 +36,7 @@ RUN \ else echo "Lockfile not found." && exit 1; \ fi -FROM python:3.14-slim AS runner +FROM docker.io/library/python:3.14-slim AS runner LABEL maintainer="Amritanshu " RUN apt-get update \ @@ -69,15 +69,6 @@ WORKDIR /app/ # Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment ENV PATH="/app/.venv/bin:$PATH" -# Pass the version from the Makefile. The build context has no usable .git -# (a git-URL build is a tag-less shallow clone and git is not installed), so -# hatch-vcs cannot discover the version itself. hatch-vcs calls -# setuptools_scm without a dist name, so only the generic -# SETUPTOOLS_SCM_PRETEND_VERSION is honored - the -# SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ variant is silently ignored. -ARG SETUPTOOLS_SCM_PRETEND_VERSION -ENV SETUPTOOLS_SCM_PRETEND_VERSION=$SETUPTOOLS_SCM_PRETEND_VERSION - # Install dependencies # Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers RUN --mount=type=cache,target=/root/.cache/uv \ @@ -87,6 +78,15 @@ RUN --mount=type=cache,target=/root/.cache/uv \ COPY /brewman ./ +# Pass the version from the Makefile. The build context has no usable .git +# (git archive stream / shallow clone lacks git metadata), so +# hatch-vcs cannot discover the version itself. hatch-vcs calls +# setuptools_scm without a dist name, so only the generic +# SETUPTOOLS_SCM_PRETEND_VERSION is honored - the +# SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ variant is silently ignored. +ARG SETUPTOOLS_SCM_PRETEND_VERSION +ENV SETUPTOOLS_SCM_PRETEND_VERSION=$SETUPTOOLS_SCM_PRETEND_VERSION + # hatch-vcs generates _version.py only inside uv's isolated wheel build, so # the source tree copied here lacks it. Write it ourselves (from the same # build arg) so importing brewman from /app works identically to the diff --git a/overlord/src/app/ledger/ledger.component.html b/overlord/src/app/ledger/ledger.component.html index f124df60..84c2dd88 100644 --- a/overlord/src/app/ledger/ledger.component.html +++ b/overlord/src/app/ledger/ledger.component.html @@ -34,7 +34,7 @@ autocomplete="off" /> - @for (account of accounts(); track account) { + @for (account of accounts(); track account.id) { {{ account.name }} }