Fix/broken docker build include patches folder#789
Open
mk0x9 wants to merge 2 commits intoslopus:mainfrom
Open
Fix/broken docker build include patches folder#789mk0x9 wants to merge 2 commits intoslopus:mainfrom
mk0x9 wants to merge 2 commits intoslopus:mainfrom
Conversation
9e99583 introduces a patch folder, it must be included during the build process, otherwise postinstall script fails
gugaevkirill
added a commit
to Go-Offer-US/happy
that referenced
this pull request
Mar 7, 2026
- Add COPY patches ./patches so postinstall can find fix-pglite-prisma-bytes.cjs - Change CMD to cd into packages/happy-server for correct @/ import and prisma path resolution Based on upstream PRs slopus#819, slopus#815, slopus#789.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
9e99583 introduces a patch folder, it must be included during the build process, otherwise postinstall script fails. Also, absolute path is used instead of relative one in the postinstall script, to ensure predictable results not depending on the current working folder.
Before
$ docker build -t happy-standalone . [+] Building 159.4s (24/31) docker:default => [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 2.10kB 0.0s => [internal] load metadata for docker.io/library/node:20-slim 0.9s => [internal] load metadata for docker.io/library/node:20 1.0s => [internal] load .dockerignore 0.0s => => transferring context: 175B 0.0s => [runner 1/6] FROM docker.io/library/node:20-slim@sha256:d8a35d586fad3af7abb6fdb9ba972388395405f4d462da9e4a4ddcde67b5e0fb 0.2s => => resolve docker.io/library/node:20-slim@sha256:d8a35d586fad3af7abb6fdb9ba972388395405f4d462da9e4a4ddcde67b5e0fb 0.2s => [internal] load build context 0.1s => => transferring context: 36.41kB 0.0s => [deps 1/16] FROM docker.io/library/node:20@sha256:65b74d0fb42134c49530a8c34e9f3e4a2fb8e1f99ac4a0eb4e6f314b426183a2 0.2s => => resolve docker.io/library/node:20@sha256:65b74d0fb42134c49530a8c34e9f3e4a2fb8e1f99ac4a0eb4e6f314b426183a2 0.2s => CACHED [runner 2/6] WORKDIR /repo 0.0s => CACHED [runner 3/6] RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/* 0.0s => CACHED [deps 2/16] RUN apt-get update && apt-get install -y python3 make g++ build-essential && rm -rf /var/lib/apt/lists/* 0.0s => CACHED [deps 3/16] WORKDIR /repo 0.0s => CACHED [deps 4/16] COPY package.json yarn.lock ./ 0.0s => CACHED [deps 5/16] COPY scripts ./scripts 0.0s => CACHED [deps 6/16] RUN mkdir -p packages/happy-app packages/happy-server packages/happy-cli packages/happy-agent packages/happy-wire 0.0s => CACHED [deps 7/16] COPY packages/happy-app/package.json packages/happy-app/ 0.0s => CACHED [deps 8/16] COPY packages/happy-server/package.json packages/happy-server/ 0.0s => CACHED [deps 9/16] COPY packages/happy-cli/package.json packages/happy-cli/ 0.0s => CACHED [deps 10/16] COPY packages/happy-agent/package.json packages/happy-agent/ 0.0s => CACHED [deps 11/16] COPY packages/happy-wire/package.json packages/happy-wire/ 0.0s => CACHED [deps 12/16] COPY packages/happy-app/patches packages/happy-app/patches 0.0s => CACHED [deps 13/16] COPY packages/happy-server/prisma packages/happy-server/prisma 0.0s => CACHED [deps 14/16] COPY packages/happy-cli/scripts packages/happy-cli/scripts 0.0s => CACHED [deps 15/16] COPY packages/happy-cli/tools packages/happy-cli/tools 0.0s => ERROR [deps 16/16] RUN SKIP_HAPPY_WIRE_BUILD=1 yarn install --frozen-lockfile --ignore-engines 157.9s ------ > [deps 16/16] RUN SKIP_HAPPY_WIRE_BUILD=1 yarn install --frozen-lockfile --ignore-engines: 0.586 yarn install v1.22.22 0.711 [1/4] Resolving packages... 1.080 [2/4] Fetching packages... 42.36 [3/4] Linking dependencies... 42.36 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > @config-plugins/react-native-webrtc@12.0.0" has incorrect peer dependency "expo@^53". 42.36 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > @shopify/flash-list@2.0.2" has unmet peer dependency "@babel/runtime@*". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > expo-router@6.0.22" has unmet peer dependency "@expo/metro-runtime@^6.1.2". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > livekit-client@2.17.0" has unmet peer dependency "@types/dom-mediacapture-record@^1". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > react-native-screen-transitions@1.2.0" has unmet peer dependency "@types/react-native@*". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > react-native-screen-transitions@1.2.0" has unmet peer dependency "@react-navigation/native-stack@>=7.0.0". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > react-native-unistyles@3.0.22" has unmet peer dependency "@react-native/normalize-colors@*". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > react-native-unistyles@3.0.22" has unmet peer dependency "react-native-edge-to-edge@*". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-server > pglite-prisma-adapter@0.7.2" has incorrect peer dependency "@prisma/client@>= 7.1.0". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > @livekit/react-native > @livekit/components-react@2.9.19" has unmet peer dependency "tslib@^2.6.2". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-coder > @modelcontextprotocol/sdk > @hono/node-server@1.19.9" has unmet peer dependency "hono@^4". 42.37 warning "workspace-aggregator-bbe18e00-9c17-482b-8707-ac305f9f0862 > happy-app > @livekit/react-native > @livekit/components-react > @livekit/components-core@0.12.12" has unmet peer dependency "tslib@^2.6.2". 42.44 warning Workspaces can only be enabled in private projects. 42.44 warning Workspaces can only be enabled in private projects. 42.44 warning Workspaces can only be enabled in private projects. 42.44 warning Workspaces can only be enabled in private projects. 42.44 warning Workspaces can only be enabled in private projects. 42.44 warning Workspaces can only be enabled in private projects. 42.44 warning Workspaces can only be enabled in private projects. 42.46 warning Workspaces can only be enabled in private projects. 42.47 warning Workspaces can only be enabled in private projects. 42.47 warning Workspaces can only be enabled in private projects. 42.47 warning Workspaces can only be enabled in private projects. 42.47 warning Workspaces can only be enabled in private projects. 149.2 [4/4] Building fresh packages... 156.7 $ node ./scripts/postinstall.cjs 156.7 node:internal/modules/cjs/loader:1210 156.7 throw err; 156.7 ^ 156.7 156.7 Error: Cannot find module '../patches/fix-pglite-prisma-bytes.cjs' 156.7 Require stack: 156.7 - /repo/scripts/postinstall.cjs 156.7 at Module._resolveFilename (node:internal/modules/cjs/loader:1207:15) 156.7 at Module._load (node:internal/modules/cjs/loader:1038:27) 156.7 at Module.require (node:internal/modules/cjs/loader:1289:19) 156.7 at require (node:internal/modules/helpers:182:18) 156.7 at Object. (/repo/scripts/postinstall.cjs:4:1) 156.7 at Module._compile (node:internal/modules/cjs/loader:1521:14) 156.7 at Module._extensions..js (node:internal/modules/cjs/loader:1623:10) 156.7 at Module.load (node:internal/modules/cjs/loader:1266:32) 156.7 at Module._load (node:internal/modules/cjs/loader:1091:12) 156.7 at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12) { 156.7 code: 'MODULE_NOT_FOUND', 156.7 requireStack: [ '/repo/scripts/postinstall.cjs' ] 156.7 } 156.7 156.7 Node.js v20.20.0 156.8 error Command failed with exit code 1. 156.8 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ------ Dockerfile:28 -------------------- 26 | COPY packages/happy-cli/tools packages/happy-cli/tools 27 | 28 | >>> RUN SKIP_HAPPY_WIRE_BUILD=1 yarn install --frozen-lockfile --ignore-engines 29 | 30 | # Stage 2: copy source and type-check -------------------- ERROR: failed to build: failed to solve: process "/bin/sh -c SKIP_HAPPY_WIRE_BUILD=1 yarn install --frozen-lockfile --ignore-engines" did not complete successfully: exit code: 1After
Closes #788