This commit is contained in:
2025-07-12 12:45:33 +08:00
parent 8daa71e7c1
commit 8404f4f1cf
5 changed files with 154 additions and 10 deletions

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# 使用官方Node.js运行时作为基础镜像
FROM node:18-alpine
# 设置工作目录
WORKDIR /app
# 复制package.json文件
COPY package*.json ./
# 安装应用依赖
RUN npm install --only=production
# 复制应用源代码
COPY . .
# 暴露端口
EXPOSE 3000
# 定义容器启动时运行的命令
CMD ["npm", "start"]