Separate out the install of dependencies so they can be cached as docker layers before the homepage source code is copied in.

This commit is contained in:
Tom Alexander
2026-10-23 20:06:19 -04:00
parent 433b52768a
commit 95a6a3eaa2
2 changed files with 13 additions and 2 deletions

View File

@@ -15,9 +15,13 @@ EOF
RUN cp "$(nix build nixpkgs#cacert --print-out-paths)/etc/ssl/certs/ca-bundle.crt" /tmp/ca-bundle.crt
COPY . /tmp/build
COPY flake.nix flake.lock /tmp/build
WORKDIR /tmp/build
RUN --mount=type=ssh GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" nix build --no-link '.#dependencies'
COPY . /tmp/build
RUN --mount=type=ssh GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" nix build '.#docker_env'
# Export the built closure to a folder