Skip to content

Commit

Permalink
feat: add args to speed up puppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
junseublim committed Dec 29, 2024
1 parent b24dd8c commit d41412b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to AWS EC2
on:
push:
branches:
- develop
- feature/save-screenshot
release:
types: [published]

Expand Down
12 changes: 11 additions & 1 deletion src/app/board/api/screenshot/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ type RequestBodyType = {
}

const initializeBrowser = async () => {
const browser = await puppeteer.launch({ args: ['--no-sandbox'] })
const browser = await puppeteer.launch({
args: [
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-setuid-sandbox',
'--no-first-run',
'--no-sandbox',
'--no-zygote',
'--single-process',
],
})
const page = await browser.newPage()
await page.setViewport({
width: 1080,
Expand Down

0 comments on commit d41412b

Please sign in to comment.