chore: 更新Dockerfile和TypeScript配置,优化代码结构

- 将基础镜像版本从Node.js 18 Alpine更新至Node.js 22 Alpine
- 修改生产阶段镜像为Node.js 22 Alpine
- 在tsconfig.json中添加对Node.js类型的支持
- 在wechat.adapter.ts中优化crypto模块的导入方式
This commit is contained in:
iHeyTang
2025-09-04 18:16:12 +08:00
parent 21a2865e43
commit 0bc27df560
3 changed files with 7 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
# 使用官方 Node.js 18 Alpine 镜像作为基础镜像
FROM node:18-alpine AS base
# 使用官方 Node.js 22 Alpine 镜像作为基础镜像
FROM node:22-alpine AS base
# 构建参数
ARG GIT_COMMIT=""
@@ -30,7 +30,7 @@ COPY . .
RUN npm run build
# 生产阶段
FROM node:18-alpine AS production
FROM node:22-alpine AS production
# 设置环境变量
ENV NODE_ENV=production
# 创建非root用户
@@ -52,4 +52,4 @@ EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
# 启动应用
CMD ["node", "dist/main"]
CMD ["node", "dist/src/main"]