mirror of
https://github.com/fccview/cronmaster.git
synced 2026-06-02 02:58:34 -04:00
add health endpoint
This commit is contained in:
@@ -48,6 +48,9 @@ EXPOSE 3000
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME="0.0.0.0"
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
||||
CMD curl -f http://localhost:3000/api/health || exit 1
|
||||
|
||||
USER nextjs
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
3
app/api/health/route.ts
Normal file
3
app/api/health/route.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export const GET = () => NextResponse.json({ status: "healthy" });
|
||||
@@ -22,3 +22,9 @@ services:
|
||||
privileged: true
|
||||
restart: always
|
||||
init: true
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
start_period: 30s
|
||||
retries: 3
|
||||
|
||||
Reference in New Issue
Block a user