fix docker build: use node for vite, bun for runtime
Some checks failed
Build and Push Docker Image / build (push) Failing after 10s
Some checks failed
Build and Push Docker Image / build (push) Failing after 10s
Bun has compatibility issues with Vite v7 + Tailwind v4 during the build step (error during build: undefined). Multi-stage build uses Node.js for the Vite build, Bun for the production server. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,16 +1,19 @@
|
||||
FROM oven/bun:1 AS base
|
||||
FROM node:22-slim AS build
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm install -g bun
|
||||
COPY package.json bun.lock* ./
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
RUN DEBUG=vite:* bun run build 2>&1
|
||||
RUN npx vite build
|
||||
|
||||
FROM oven/bun:1
|
||||
WORKDIR /app
|
||||
COPY package.json bun.lock* ./
|
||||
RUN bun install --frozen-lockfile --production
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY server ./server
|
||||
EXPOSE 3000
|
||||
ENV DATA_DIR=/data
|
||||
ENV PORT=3000
|
||||
|
||||
VOLUME ["/data"]
|
||||
|
||||
CMD ["bun", "run", "server/index.tsx"]
|
||||
|
||||
Reference in New Issue
Block a user