Skip to content

Commit

Permalink
Merge pull request #141 from canopas/fix-puppeteer-issue
Browse files Browse the repository at this point in the history
Fix: puppeteer issue
  • Loading branch information
cp-sumi-k committed Feb 13, 2024
2 parents 56c7431 + 146c98a commit 4834421
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ node_modules
.env

#build
.strapi
.cache
build

Expand Down
2 changes: 2 additions & 0 deletions admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ WORKDIR /app
# Bundle app source
COPY . .

RUN apt-get update && apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2

RUN mkdir public/uploads

RUN yarn install --frozen-lockfile
Expand Down
5 changes: 4 additions & 1 deletion admin/src/api/post/content-types/post/lifecycles.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,10 @@ async function generatePreview(event) {
}

async function runScraper(url) {
const browser = await puppeteer.launch({ headless: "old" });
const browser = await puppeteer.launch({
headless: true,
args: ["--no-sandbox"],
});
try {
const page = await browser.newPage();
await page.goto(url);
Expand Down

0 comments on commit 4834421

Please sign in to comment.