提交 20f01a9f authored 作者: 王鹏飞's avatar 王鹏飞

chore: 添加启动脚本并更新 Dockerfile 以使用该脚本启动服务

上级 f5649429
...@@ -32,7 +32,11 @@ ENV NITRO_PORT=2048 ...@@ -32,7 +32,11 @@ ENV NITRO_PORT=2048
# 只复制构建产物 # 只复制构建产物
COPY --from=builder /app/.output ./.output COPY --from=builder /app/.output ./.output
# 复制启动脚本并赋予可执行权限
COPY --from=builder /app/start.sh ./start.sh
RUN chmod +x ./start.sh
EXPOSE 2048 EXPOSE 2048
# 启动 Nitro Server(Nuxt 4) # 启动 Nitro Server(Nuxt 4)
CMD ["node", ".output/server/index.mjs"] CMD ["./start.sh"]
#!/usr/bin/env bash
# 写hosts配置项 - 仅在测试环境生效
tee /etc/hosts <<- 'EOF'
# 指定配置host
EOF
# 启动服务
node .output/server/index.mjs
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论