fix(docker): add curl and healthcheck routes for Coolify
This commit is contained in:
@@ -16,6 +16,7 @@ RUN pnpm install --frozen-lockfile --filter @menulio/api...
|
||||
RUN pnpm --filter @menulio/api build
|
||||
|
||||
FROM node:22-alpine AS runner
|
||||
RUN apk add --no-cache curl wget libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
@@ -34,4 +35,7 @@ USER fastify
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:3000/health || exit 1
|
||||
|
||||
CMD ["node", "apps/api/dist/index.js"]
|
||||
|
||||
@@ -41,6 +41,7 @@ RUN pnpm --filter @menulio/web build
|
||||
|
||||
# 3. Production runner
|
||||
FROM node:22-alpine AS runner
|
||||
RUN apk add --no-cache curl wget libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
@@ -60,4 +61,7 @@ USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:3000/api/health || exit 1
|
||||
|
||||
CMD ["node", "apps/web/server.js"]
|
||||
|
||||
@@ -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