remove health
This commit is contained in:
@@ -37,9 +37,6 @@ USER nodejs
|
|||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
|
||||||
RUN npx prisma generate
|
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" ]
|
CMD [ "sh", "-c", "npm run db:push && npm run db:seed && npm run start" ]
|
||||||
@@ -47,9 +47,6 @@ app.use(express.urlencoded({ extended: true }));
|
|||||||
|
|
||||||
// Request logging
|
// Request logging
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
if (req.path === '/health') {
|
|
||||||
return next();
|
|
||||||
}
|
|
||||||
logger.info(`${req.method} ${req.path}`, {
|
logger.info(`${req.method} ${req.path}`, {
|
||||||
ip: req.ip,
|
ip: req.ip,
|
||||||
userAgent: req.get('User-Agent')
|
userAgent: req.get('User-Agent')
|
||||||
@@ -57,15 +54,6 @@ app.use((req, res, next) => {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Health check endpoint
|
|
||||||
app.get('/health', (req, res) => {
|
|
||||||
res.json({
|
|
||||||
status: 'OK',
|
|
||||||
timestamp: new Date().toISOString(),
|
|
||||||
uptime: process.uptime()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// API routes
|
// API routes
|
||||||
app.use('/api/auth', authRoutes);
|
app.use('/api/auth', authRoutes);
|
||||||
app.use('/api/users', userRoutes);
|
app.use('/api/users', userRoutes);
|
||||||
|
|||||||
Reference in New Issue
Block a user