Skip to content

Commit 29dc8b5

Browse files
authored
Merge pull request #176 from Lemoncode/fix/front-cd
update
2 parents e66f579 + 8b4ccb9 commit 29dc8b5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

front/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@ COPY front/package.json ./front/package.json
1212
COPY packages/db-model/package.json ./packages/db-model/package.json
1313

1414
# 2) Install all dependencies for the monorepo (npm workspaces)
15-
# We need dev deps here because Next build typically requires them.
16-
RUN npm ci
15+
# --ignore-scripts: postinstall scripts can't run yet (source not copied)
16+
RUN npm ci --ignore-scripts
1717

1818
# 3) Now copy the full source code
1919
COPY . .
2020

2121
# 4) Remove packageManager field to prevent Corepack (Node 22) from
2222
# hijacking yarn calls that Next.js SWC patching makes internally.
23-
# Must run AFTER "COPY . ." which overwrites the earlier package.json.
24-
RUN node -e "const p='package.json',j=JSON.parse(require('fs').readFileSync(p));delete j.packageManager;require('fs').writeFileSync(p,JSON.stringify(j,null,2))"
23+
# Then rebuild native modules (e.g. @tailwindcss/oxide) that were
24+
# skipped by --ignore-scripts above.
25+
RUN node -e "const p='package.json',j=JSON.parse(require('fs').readFileSync(p));delete j.packageManager;require('fs').writeFileSync(p,JSON.stringify(j,null,2))" \
26+
&& npm rebuild
2527

2628
# 5) Build the internal dependency used by the front (db-model)
27-
# If your workspace name differs, adjust "-w db-model"
2829
RUN npm run -w db-model build --if-present
2930

3031
# 6) Build Next.js (standalone output will be generated)

0 commit comments

Comments
 (0)