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"]