From 831985bb3fdb18b034030378cd286d0c58a04a6e Mon Sep 17 00:00:00 2001 From: Atridad Date: Mon, 30 Jun 2025 14:08:49 -0600 Subject: [PATCH] fixed build --- Dockerfile | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b5f8bf..8c4889a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM node:24 AS builder +FROM node:24-alpine AS builder WORKDIR /app # Install pnpm RUN npm i -g pnpm -# Copy package files first for better caching +# Copy package files COPY package.json pnpm-lock.yaml ./ # Install dependencies @@ -18,22 +18,10 @@ COPY . . RUN pnpm run build # Production stage -FROM node:18 AS runtime +FROM mcr.microsoft.com/playwright:v1.50.0-noble AS runtime WORKDIR /app -# We don't need the standalone Chromium -ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true - -# Install Google Chrome Stable and fonts -# Note: this installs the necessary libs to make the browser work with Puppeteer. -RUN apt-get update && apt-get install curl gnupg -y \ - && curl --location --silent https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ - && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ - && apt-get update \ - && apt-get install google-chrome-stable -y --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* - # Install pnpm RUN npm i -g pnpm @@ -41,8 +29,10 @@ RUN npm i -g pnpm COPY --from=builder /app/dist ./dist COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./ -# Install production dependencies -RUN pnpm install --prod --frozen-lockfile && pnpm store prune +# Install production dependencies and clean up in one layer +RUN pnpm install --prod --frozen-lockfile \ + && pnpm store prune \ + && npm cache clean --force # Set environment variables ENV HOST=0.0.0.0 \ @@ -52,9 +42,5 @@ ENV HOST=0.0.0.0 \ # Expose port EXPOSE 4321 -# Health check -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:4321/ || exit 1 - # Start the application -CMD ["node", "./dist/server/entry.mjs"] +CMD ["node", "./dist/server/entry.mjs"] \ No newline at end of file