Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# syntax=docker/dockerfile:1
FROM oven/bun:debian AS deps
WORKDIR /app
COPY package.json bun.lockb* ./
RUN bun install --frozen-lockfile
Comment thread
h7ml marked this conversation as resolved.

FROM oven/bun:debian AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
Comment thread
h7ml marked this conversation as resolved.
Comment thread
h7ml marked this conversation as resolved.
ENV NEXT_TELEMETRY_DISABLED=1
ENV CI=true
RUN bun run build
Comment thread
h7ml marked this conversation as resolved.

FROM node:20-slim AS runner
Comment thread
h7ml marked this conversation as resolved.
Comment thread
h7ml marked this conversation as resolved.
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=8080
Comment thread
h7ml marked this conversation as resolved.
Comment thread
h7ml marked this conversation as resolved.
EXPOSE 8080
Comment thread
h7ml marked this conversation as resolved.

# 关键:确保复制了所有必要的文件,特别是 drizzle 文件夹
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
Comment thread
h7ml marked this conversation as resolved.
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/drizzle ./drizzle
Comment thread
h7ml marked this conversation as resolved.
Comment thread
h7ml marked this conversation as resolved.

CMD ["node", "node_modules/.bin/next", "start"]
Comment thread
h7ml marked this conversation as resolved.
Comment thread
h7ml marked this conversation as resolved.
Comment thread
h7ml marked this conversation as resolved.
Comment thread
h7ml marked this conversation as resolved.
Loading