File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ RUN chown -R appuser:appgroup /app
3232# Install *only* the production dependencies
3333RUN npm ci --ignore-scripts --omit-dev
3434
35+ RUN apk add --no-cache chromium nss freetype harfbuzz ca-certificates ttf-freefont
36+
37+ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
38+
3539# Now, switch to running as our non-root user for the actual app process
3640USER appuser
3741
Original file line number Diff line number Diff line change @@ -205,7 +205,10 @@ async function generateRichMenuImage(
205205 await fsp . writeFile ( tempHtmlPath , htmlContent , "utf8" ) ;
206206
207207 // 4. Use puppeteer to convert HTML to PNG
208- const browser = await puppeteer . launch ( ) ;
208+ const browser = await puppeteer . launch ( {
209+ args : [ "--no-sandbox" , "--disable-setuid-sandbox" ] ,
210+ executablePath : process . env . PUPPETEER_EXECUTABLE_PATH ,
211+ } ) ;
209212 const page = await browser . newPage ( ) ;
210213 await page . setViewport ( { width : RICHMENU_WIDTH , height : RICHMENU_HEIGHT } ) ;
211214 await page . goto ( `file://${ tempHtmlPath } ` , {
You can’t perform that action at this time.
0 commit comments