Skip to content

Commit

Permalink
feat(scully): prepare scully for running inside Docker container (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman authored and SanderElias committed Jan 1, 2020
1 parent 497415f commit b319db3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scully/renderPlugins/launchedBrowser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Browser, launch, LaunchOptions} from 'puppeteer';
import {Observable} from 'rxjs';
import {shareReplay, take} from 'rxjs/operators';
import {log} from '../utils/log';
import * as yargs from 'yargs';

const {showBrowser} = yargs
Expand All @@ -20,6 +21,12 @@ function obsBrowser(
args: ['--no-sandbox', '--disable-setuid-sandbox'],
}
): Observable<Browser> {
const { SCULLY_PUPPETEER_EXECUTABLE_PATH } = process.env;
if (SCULLY_PUPPETEER_EXECUTABLE_PATH) {
log(`Launching puppeteer with executablePath ${SCULLY_PUPPETEER_EXECUTABLE_PATH}`);
options.executablePath = SCULLY_PUPPETEER_EXECUTABLE_PATH;
options.args = [...options.args, '--disable-dev-shm-usage'];
}
return new Observable(obs => {
const promisedBrowser = launch(options);
promisedBrowser
Expand Down

0 comments on commit b319db3

Please sign in to comment.