Skip to content

Commit

Permalink
feat: puppeteer performance
Browse files Browse the repository at this point in the history
  • Loading branch information
junseublim committed Dec 30, 2024
1 parent 6a30a79 commit 1b3cc23
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 @@ -46,4 +46,4 @@ jobs:
- name: Delete existing container
run: docker rm -f polabo-fe || true
- name: Run container
run: docker run -d -p 3000:3000 --name polabo-fe ${{ vars.DOCKER_IMAGE }}
run: docker run -d -p 3000:3000 --shm-size=1g --name polabo-fe ${{ vars.DOCKER_IMAGE }}
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: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-gpu',
'--no-zygote',
'--no-first-run',
'--disable-default-apps',
],
defaultViewport: null,
})
const page = await browser.newPage()
await page.setViewport({
width: 1080,
Expand Down

0 comments on commit 1b3cc23

Please sign in to comment.