feat: adicionar healthcheck no frontend para evitar bad gateway
This commit is contained in:
@@ -41,6 +41,12 @@ services:
|
||||
container_name: occto_frontend_dev
|
||||
expose:
|
||||
- "3000"
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/api/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_URL=postgresql://admin:adminpassword@postgres_dev:5432/occto_db_dev?schema=public
|
||||
|
||||
5
frontend/src/app/api/health/route.ts
Normal file
5
frontend/src/app/api/health/route.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export async function GET() {
|
||||
return NextResponse.json({ status: 'ok', timestamp: new Date().toISOString() });
|
||||
}
|
||||
Reference in New Issue
Block a user