Replace the previous base image 'oven/bun:latest' with 'dhi.io/bun:1-debian13-dev'. This updates the underlying OS to Debian 13 and pins the Bun version for better consistency.
15 lines
379 B
Plaintext
15 lines
379 B
Plaintext
FROM dhi.io/bun:1-debian13-dev
|
|
|
|
WORKDIR /app
|
|
COPY . .
|
|
|
|
# 1. 安装依赖并生成 Prisma Client (构建阶段只需生成类型)
|
|
RUN bun install
|
|
RUN bun prisma generate
|
|
|
|
# 暴露端口
|
|
EXPOSE 3000
|
|
|
|
# 2. 使用脚本或直接在启动时执行迁移
|
|
# 这样每次容器启动前都会检查并应用增量更新
|
|
ENTRYPOINT [ "sh", "-c", "bun prisma migrate deploy && bun start" ] |