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 ...
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.