From 82f2b74300440e843c59d77a230ddea0d409f341 Mon Sep 17 00:00:00 2001 From: Chris Yau Date: Tue, 24 Mar 2026 21:18:41 +0800 Subject: [PATCH 1/2] fix: gitignore .env.production + Docker build fixes (#868, #866) 1. **.gitignore**: Add `.env.production` to prevent accidental commit of secrets like HANDY_MASTER_SECRET (#868) 2. **Dockerfile**: Add missing `COPY patches ./patches` so postinstall.cjs can find `fix-pglite-prisma-bytes.cjs` during `yarn install` (#866) 3. **standalone.ts**: Add `__dirname`-relative candidate for prisma/migrations path so the migration finder works regardless of WORKDIR (#866) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .gitignore | 1 + Dockerfile | 1 + packages/happy-server/sources/standalone.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 5ed397e6e5..1eb9e32678 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ yarn-error.* # local env files .env*.local .env +.env.production # typescript *.tsbuildinfo diff --git a/Dockerfile b/Dockerfile index 296b9da809..d7d8c25967 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ WORKDIR /repo COPY package.json yarn.lock ./ COPY scripts ./scripts +COPY patches ./patches RUN mkdir -p packages/happy-app packages/happy-server packages/happy-cli packages/happy-agent packages/happy-wire diff --git a/packages/happy-server/sources/standalone.ts b/packages/happy-server/sources/standalone.ts index 76495fc82f..12e48a8ceb 100644 --- a/packages/happy-server/sources/standalone.ts +++ b/packages/happy-server/sources/standalone.ts @@ -46,6 +46,7 @@ async function migrate() { let migrationsDirResolved = ""; const candidates = [ path.join(process.cwd(), "prisma", "migrations"), + path.join(__dirname, "..", "prisma", "migrations"), path.join(path.dirname(process.execPath), "prisma", "migrations"), ]; for (const candidate of candidates) { From dd6c018aa92dd1b0e1b5a049c51ac9da85b2077b Mon Sep 17 00:00:00 2001 From: Chris Yau Date: Tue, 24 Mar 2026 21:36:34 +0800 Subject: [PATCH 2/2] fix: use cwd-relative path for Docker migration lookup (ESM-safe) __dirname is unavailable in ESM and the server tsconfig uses commonjs, so use process.cwd() + known monorepo path instead. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- packages/happy-server/sources/standalone.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/happy-server/sources/standalone.ts b/packages/happy-server/sources/standalone.ts index 12e48a8ceb..09be7da124 100644 --- a/packages/happy-server/sources/standalone.ts +++ b/packages/happy-server/sources/standalone.ts @@ -46,7 +46,7 @@ async function migrate() { let migrationsDirResolved = ""; const candidates = [ path.join(process.cwd(), "prisma", "migrations"), - path.join(__dirname, "..", "prisma", "migrations"), + path.join(process.cwd(), "packages", "happy-server", "prisma", "migrations"), path.join(path.dirname(process.execPath), "prisma", "migrations"), ]; for (const candidate of candidates) {