Files
droid2api/Dockerfile
empty 3670aceb4a fix: 修复 Dockerfile 构建问题
- Node 24 → Node 20(更稳定)
- --only=production → --omit=dev(新语法)
2025-12-27 17:00:07 +08:00

24 lines
410 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 使用官方 Node.js 运行时作为基础镜像
FROM node:20-alpine
# 设置工作目录
WORKDIR /app
# 复制 package.json 和 package-lock.json
COPY package*.json ./
# 安装项目依赖
RUN npm ci --omit=dev
# 复制项目文件
COPY . .
# 暴露端口默认3000可通过环境变量覆盖
EXPOSE 3000
# 设置环境变量
ENV NODE_ENV=production
# 启动应用
CMD ["node", "server.js"]