Skip to content

A local-first personal finance app

[AI] sync-server.Dockerfile: unbreak `yarn build:server` after lage migration (#7861)

Matiss Janis Aboltins4117c34042a4
diff --git a/sync-server.Dockerfile b/sync-server.Dockerfile
index 4c2f56a2a9..8d0560b58b 100644
--- a/sync-server.Dockerfile
+++ b/sync-server.Dockerfile
@@ -7,7 +7,7 @@ WORKDIR /app
# Copy only the files needed for installing dependencies
COPY .yarn ./.yarn
-COPY yarn.lock package.json .yarnrc.yml tsconfig.json ./
+COPY yarn.lock package.json .yarnrc.yml tsconfig.json lage.config.js ./
COPY packages/api/package.json packages/api/package.json
COPY packages/component-library/package.json packages/component-library/package.json
COPY packages/crdt/package.json packages/crdt/package.json
@@ -31,6 +31,13 @@ COPY packages/ ./packages/
# Increase memory limit for the build process to 8GB
ENV NODE_OPTIONS=--max_old_space_size=8192
+# lage's task hasher invokes `git ls-tree HEAD` during initialization, so it
+# needs a git repo even when individual targets disable caching. .dockerignore
+# omits the real .git, so seed a throwaway repo with a single commit here.
+RUN git -c init.defaultBranch=master init -q \
+ && git -c user.email=build@docker -c user.name=docker-build add -A \
+ && git -c user.email=build@docker -c user.name=docker-build commit -qm build
+
RUN yarn build:server
# Focus the workspaces in production mode (including @actual-app/web you just built)
diff --git a/upcoming-release-notes/7861.md b/upcoming-release-notes/7861.md
new file mode 100644
index 0000000000..c1b0545360
--- /dev/null
+++ b/upcoming-release-notes/7861.md
@@ -0,0 +1,6 @@
+---
+category: Bugfixes
+authors: [MatissJanis]
+---
+
+Update Dockerfile to ensure `yarn build:server` works after lage migration.