fix: prisma db push 移到启动时执行(保留用户数据)
构建时执行会覆盖用户拷贝的数据库文件, 改为容器启动时执行,已有数据则跳过。
This commit is contained in:
+4
-2
@@ -18,7 +18,6 @@ RUN npm install -g pnpm@9
|
|||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
RUN pnpm exec prisma db push --skip-generate
|
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# ── 运行层 ──
|
# ── 运行层 ──
|
||||||
@@ -47,4 +46,7 @@ EXPOSE 3000
|
|||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
COPY start.sh ./start.sh
|
||||||
|
RUN chmod +x ./start.sh
|
||||||
|
|
||||||
|
CMD ["sh", "./start.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user