gildas-lormeau / single-file-cli

CLI tool for saving a faithful copy of a complete web page in a single HTML file (based on SingleFile)
GNU Affero General Public License v3.0
540 stars 58 forks source link

When spawning singlefile from within a docker container, it will leave defunct chrome processes behind. #26

Open felixkosmalla opened 1 year ago

felixkosmalla commented 1 year ago

This is not a problem when doing single-shot executions with a docker container that starts, runs singlefile, and stops again. However, when running a small flask server as a frontend to singlefile which spawns singlefile via subprocess, it will leave a couple of defunct chrome processes behind.

It seems this is a general problem with puppeteer and does not originate from singelfile itself. To overcome this issue, tini can be used as a prefix when calling singlefile which makes sure to terminate all child processes:

tini -s /usr/src/app/node_modules/single-file-cli/single-file ...

Leaving this here for documentation purposes.