Skip to content

Commit b319db3

Browse files
beemanSanderElias
authored andcommitted
feat(scully): prepare scully for running inside Docker container (#109)
1 parent 497415f commit b319db3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scully/renderPlugins/launchedBrowser.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Browser, launch, LaunchOptions} from 'puppeteer';
22
import {Observable} from 'rxjs';
33
import {shareReplay, take} from 'rxjs/operators';
4+
import {log} from '../utils/log';
45
import * as yargs from 'yargs';
56

67
const {showBrowser} = yargs
@@ -20,6 +21,12 @@ function obsBrowser(
2021
args: ['--no-sandbox', '--disable-setuid-sandbox'],
2122
}
2223
): Observable<Browser> {
24+
const { SCULLY_PUPPETEER_EXECUTABLE_PATH } = process.env;
25+
if (SCULLY_PUPPETEER_EXECUTABLE_PATH) {
26+
log(`Launching puppeteer with executablePath ${SCULLY_PUPPETEER_EXECUTABLE_PATH}`);
27+
options.executablePath = SCULLY_PUPPETEER_EXECUTABLE_PATH;
28+
options.args = [...options.args, '--disable-dev-shm-usage'];
29+
}
2330
return new Observable(obs => {
2431
const promisedBrowser = launch(options);
2532
promisedBrowser

0 commit comments

Comments
 (0)