Skip to content

Commit 9d4e2f2

Browse files
aster-voidclaude
andcommitted
server: fix drizzle-kit push in Docker
Preserve workspace node_modules by copying source files individually instead of the whole apps/server directory. Also copy both root and workspace node_modules to maintain bun's module resolution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 6757b4e commit 9d4e2f2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

apps/server/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ COPY apps/desktop/package.json ./apps/desktop/
66
COPY apps/server/package.json ./apps/server/
77
COPY packages/api-client/package.json ./packages/api-client/
88
RUN bun install --frozen-lockfile --ignore-scripts
9-
COPY apps/server ./apps/server
9+
# Copy source files individually to preserve node_modules created by bun install
10+
COPY apps/server/src ./apps/server/src
11+
COPY apps/server/drizzle ./apps/server/drizzle
12+
COPY apps/server/drizzle.config.ts ./apps/server/drizzle.config.ts
13+
COPY apps/server/tsconfig.json ./apps/server/tsconfig.json
1014
RUN cd apps/server && bun build src/index.ts --outdir dist --target bun
1115

1216
FROM oven/bun:1.3.2
13-
WORKDIR /app
17+
WORKDIR /app/apps/server
1418
ENV NODE_ENV=production
1519
COPY --from=builder /app/apps/server/dist ./dist
16-
COPY --from=builder /app/node_modules ./node_modules
20+
COPY --from=builder /app/node_modules ../../node_modules
21+
COPY --from=builder /app/apps/server/node_modules ./node_modules
1722
# Copy files needed for drizzle-kit push
1823
COPY --from=builder /app/apps/server/drizzle.config.ts ./drizzle.config.ts
1924
COPY --from=builder /app/apps/server/src ./src

0 commit comments

Comments
 (0)