feat: 添加 Docker 部署支持,包括 Dockerfile、docker-compose.yml 和部署脚本
This commit is contained in:
19
packages/distribute/Dockerfile
Normal file
19
packages/distribute/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
# 使用预构建产物运行 - 轻量级镜像
|
||||
FROM node:20-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 设置生产环境
|
||||
ENV NODE_ENV=production
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
# 复制预构建的产物(本地执行 pnpm build 后生成)
|
||||
COPY .output /app/.output
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 3000
|
||||
|
||||
# 启动应用
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
Reference in New Issue
Block a user