debug2 Add health check.
This commit is contained in:
parent
91663a6a13
commit
0163f6365b
17
Dockerfile
17
Dockerfile
|
|
@ -1,9 +1,11 @@
|
||||||
FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
# Install curl for healthcheck
|
||||||
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
# Enable pnpm
|
# Enable pnpm
|
||||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||||
|
|
||||||
# Set working directory
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy files
|
# Copy files
|
||||||
|
|
@ -12,19 +14,14 @@ COPY . .
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
# Build the SvelteKit app
|
# Build SvelteKit app
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# Expose default port
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Set environment
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
# # add health check
|
# Healthcheck using curl (more reliable on Coolify)
|
||||||
# HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
||||||
# CMD wget -qO- http://localhost:3000/_healthz || exit 1
|
CMD curl -fs http://localhost:3000/_healthz || exit 1
|
||||||
|
|
||||||
|
|
||||||
# Start the SvelteKit app
|
|
||||||
CMD ["node", "build"]
|
CMD ["node", "build"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue