From 0163f6365b7999261b26d9df87ed916a8bc7cb27 Mon Sep 17 00:00:00 2001 From: gtrefalt Date: Tue, 28 Oct 2025 21:53:01 +0100 Subject: [PATCH] debug2 Add health check. --- Dockerfile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index cee8637..901868c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,11 @@ FROM node:20-alpine +# Install curl for healthcheck +RUN apk add --no-cache curl + # Enable pnpm RUN corepack enable && corepack prepare pnpm@latest --activate -# Set working directory WORKDIR /app # Copy files @@ -12,19 +14,14 @@ COPY . . # Install dependencies RUN pnpm install --frozen-lockfile -# Build the SvelteKit app +# Build SvelteKit app RUN pnpm run build -# Expose default port EXPOSE 3000 - -# Set environment ENV NODE_ENV=production -# # add health check -# HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ -# CMD wget -qO- http://localhost:3000/_healthz || exit 1 +# Healthcheck using curl (more reliable on Coolify) +HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ + CMD curl -fs http://localhost:3000/_healthz || exit 1 - -# Start the SvelteKit app CMD ["node", "build"]