i-tools/Dockerfile
2024-12-05 13:18:54 +08:00

24 lines
458 B
Docker
Raw 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:18-alpine
# 设置工作目录
WORKDIR /app
# 复制 package.json 和 package-lock.json如果有到工作目录
COPY package*.json ./
# 安装项目依赖
RUN npm install
# 复制项目文件到工作目录
COPY . .
# 构建项目(如果需要)
RUN npm run build
# 暴露应用运行的端口(假设应用运行在 3000 端口)
EXPOSE 3000
# 启动应用
CMD ["npm", "start"]