1515# Set Python 3 as the default python
1616RUN ln -s /usr/bin/python3 /usr/bin/python
1717
18+ FROM builder as installer
19+
1820# Copy package files
1921COPY .npmrc .
2022COPY package.json .
@@ -27,7 +29,6 @@ COPY scripts ./scripts
2729COPY packages ./packages
2830
2931
30-
3132# Install dependencies
3233RUN bun install
3334RUN bun add better-sqlite3
@@ -36,7 +37,7 @@ RUN bun add better-sqlite3
3637RUN bun run build
3738
3839# Create a new stage for the final image
39- FROM node:23.3.0-slim
40+ FROM builder
4041
4142WORKDIR /app
4243
@@ -49,15 +50,15 @@ RUN apt-get update && \
4950# Install bun using npm
5051RUN npm install -g bun
[email protected] 5152
52- # Copy built artifacts and production dependencies from the builder stage
53- COPY --from=builder /app/package.json ./
54- COPY --from=builder /app/tsconfig.json ./
55- COPY --from=builder /app/turbo.json ./
56- COPY --from=builder /app/lerna.json ./
57- COPY --from=builder /app/renovate.json ./
58- COPY --from=builder /app/node_modules ./node_modules
59- COPY --from=builder /app/packages ./packages
60- COPY --from=builder /app/scripts ./scripts
53+ # Copy built artifacts and production dependencies from the installer stage
54+ COPY --from=installer /app/package.json ./
55+ COPY --from=installer /app/tsconfig.json ./
56+ COPY --from=installer /app/turbo.json ./
57+ COPY --from=installer /app/lerna.json ./
58+ COPY --from=installer /app/renovate.json ./
59+ COPY --from=installer /app/node_modules ./node_modules
60+ COPY --from=installer /app/packages ./packages
61+ COPY --from=installer /app/scripts ./scripts
6162
6263# Set environment variables
6364ENV NODE_ENV=production
0 commit comments