Files
pihkaal-me/Dockerfile
Pihkaal 39f549f156
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m42s
feat: health check
2026-05-16 17:19:36 +02:00

24 lines
794 B
Docker

FROM node:22-slim AS base
RUN corepack enable
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
FROM base AS build
RUN apt-get update && apt-get install -y --no-install-recommends imagemagick && rm -rf /var/lib/apt/lists/* && ln -s /usr/bin/convert /usr/local/bin/magick
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN pnpm build
FROM base AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/.output ./.output
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -sf http://localhost:3000/api/health || exit 1
CMD ["node", ".output/server/index.mjs"]