feat: 添加Docker支持,支持容器化部署

This commit is contained in:
lulistart
2026-02-18 03:17:44 +08:00
parent b99dfcc666
commit 5db6f0caf1
4 changed files with 79 additions and 4 deletions

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# 使用 Node.js 18 LTS 版本
FROM node:18-alpine
# 设置工作目录
WORKDIR /app
# 复制 package.json 和 package-lock.json
COPY package*.json ./
# 安装依赖
RUN npm ci --only=production
# 复制项目文件
COPY . .
# 创建数据库目录
RUN mkdir -p database
# 暴露端口
EXPOSE 3000
# 启动命令
CMD ["npm", "start"]