File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * @type {import("puppeteer").Configuration }
3+ */
4+ module . exports = {
5+ skipDownload : true ,
6+ }
Original file line number Diff line number Diff line change 55 "build" : " nitro build" ,
66 "dev" : " nitro dev" ,
77 "prepare" : " nitro prepare" ,
8- "preview" : " node .output/server/index.mjs" ,
9- "postinstall" : " puppeteer browsers install chrome"
8+ "preview" : " node .output/server/index.mjs"
109 },
1110 "dependencies" : {
1211 "@roll-stack/database" : " workspace:*" ,
Original file line number Diff line number Diff line change 1- import { type } from 'arktype'
21import { H3Error } from 'h3'
32
43const logger = useLogger ( 'error' )
54
65export function errorResolver ( exception : unknown ) {
7- if ( exception instanceof type . errors ) {
8- throw createError ( {
9- statusCode : 400 ,
10- message : exception . summary ,
11- } )
12- }
13-
146 if ( exception instanceof H3Error ) {
157 throw exception
168 }
Original file line number Diff line number Diff line change 11FROM node:22.17.1-alpine AS base
2- ENV NODE_OPTIONS="--max_old_space_size=4096"
32
43# Builder stage
54FROM base AS builder
65WORKDIR /app
76COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
8- COPY packages ./packages
7+ COPY packages/database ./packages/database
8+ COPY apps/web-parser/.puppeteerrc.cjs ./
99COPY apps/web-parser ./apps/web-parser
1010RUN npm install --ignore-scripts -g pnpm && \
1111 pnpm i --frozen-lockfile && \
1212 pnpm build --filter @roll-stack/web-parser
1313
14+ RUN pnpm dlx puppeteer browsers install chrome
15+
1416# Production stage
1517FROM base AS production
1618RUN apk add --no-cache curl
1719WORKDIR /app
1820
1921# Copy built artifacts from builder
2022COPY --from=builder /app/apps/web-parser/.output .
23+ COPY --from=builder /root/.cache/puppeteer /home/appuser/.cache/puppeteer
2124COPY docker/web-parser/health-check.sh ./
2225
2326# Running as non-root is a security best practice
You can’t perform that action at this time.
0 commit comments