From 33e640f1e8654fcfc8102b43449c79bcb4d5ddff Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 14 Nov 2020 19:38:26 +0300 Subject: build: setup docker correctly --- src/handlers/index.js | 2 +- src/handlers/launchUserSession.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/handlers/index.js b/src/handlers/index.js index e6f84df..18946fc 100644 --- a/src/handlers/index.js +++ b/src/handlers/index.js @@ -8,7 +8,7 @@ const { clickElementBySelector } = require('./utils.js'); const { EDUFPMI_URL, NODE_ENV, HEADLESS } = process.env; // Always run headless in production, but allow configuring for development -const headless = NODE_ENV === 'production' || HEADLESS || false; +const headless = NODE_ENV === 'production' || HEADLESS; const handleJobAsUser = async (job, user) => { diff --git a/src/handlers/launchUserSession.js b/src/handlers/launchUserSession.js index 58dde62..44f2193 100644 --- a/src/handlers/launchUserSession.js +++ b/src/handlers/launchUserSession.js @@ -3,8 +3,10 @@ const { clickElementBySelector } = require('./utils.js'); const { EDUFPMI_URL } = process.env; -const launchUserSession = (user, headless = true) => puppeteer.launch({ headless }) - .then(async browser => { +const launchUserSession = (user, headless = true) => puppeteer.launch({ + headless, + args: ['--no-sandbox'] +}).then(async browser => { const { username, password } = user; const page = await browser.newPage(); -- cgit v1.2.3