From 0fe89e1fbb5c742ea280bc31037bc6237ebc659f Mon Sep 17 00:00:00 2001 From: liangweihao <734499798@qq.com> Date: Mon, 21 Jul 2025 22:12:54 +0800 Subject: [PATCH] remove health --- backend/Dockerfile | 3 --- backend/src/index.ts | 12 ------------ 2 files changed, 15 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index b47c71d..6a1871f 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -37,9 +37,6 @@ USER nodejs EXPOSE 3001 RUN npx prisma generate -# 健康检查 -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:3001/health || exit 1 # 启动命令 CMD [ "sh", "-c", "npm run db:push && npm run db:seed && npm run start" ] \ No newline at end of file diff --git a/backend/src/index.ts b/backend/src/index.ts index b83f8e2..5472516 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -47,9 +47,6 @@ app.use(express.urlencoded({ extended: true })); // Request logging app.use((req, res, next) => { - if (req.path === '/health') { - return next(); - } logger.info(`${req.method} ${req.path}`, { ip: req.ip, userAgent: req.get('User-Agent') @@ -57,15 +54,6 @@ app.use((req, res, next) => { next(); }); -// Health check endpoint -app.get('/health', (req, res) => { - res.json({ - status: 'OK', - timestamp: new Date().toISOString(), - uptime: process.uptime() - }); -}); - // API routes app.use('/api/auth', authRoutes); app.use('/api/users', userRoutes);