From 364a24ad5417b76037640b970aa5ad671bd0a3a4 Mon Sep 17 00:00:00 2001 From: J-E Castagnede Date: Thu, 23 Nov 2023 10:20:20 +0100 Subject: [PATCH] fix subprocess remaining --- Dockerfile | 4 +--- src/screenshotter/puppeteer.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d2235f43..cc133230 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ RUN mkdir -p /app/static RUN chown django:django /app RUN apt-get -qq update && apt-get install -qq -y \ + dumb-init \ gconf-service \ libasound2 \ libatk1.0-0 \ @@ -103,8 +104,6 @@ COPY --from=build /app/node_modules /app/node_modules COPY src /app/src RUN mkdir -p /app/static && chown django:django /app/static -ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/local/bin/dumb-init -RUN chmod +x /usr/local/bin/dumb-init RUN apt-get -qq update && apt-get upgrade -qq -y && \ apt-get clean all && rm -rf /var/apt/lists/* && rm -rf /var/cache/apt/* @@ -113,6 +112,5 @@ VOLUME /app/static USER django -ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/entrypoint.sh"] CMD gunicorn screamshotter.wsgi:application -w $WORKERS --max-requests $MAX_REQUESTS --timeout `expr $TIMEOUT + 10` --bind 0.0.0.0:8000 --worker-tmp-dir /dev/shm diff --git a/src/screenshotter/puppeteer.py b/src/screenshotter/puppeteer.py index 23394dc4..10653b16 100644 --- a/src/screenshotter/puppeteer.py +++ b/src/screenshotter/puppeteer.py @@ -19,7 +19,7 @@ def take_screenshot(url, width=1920, height=1080, waitfor='body', wait_selectors # We send sentry informations and version : when we use screamshotter as a package, informations are in settings only with NamedTemporaryFile(suffix='.png') as screenshot_file: command = subprocess.run([ - "/usr/local/bin/dumb-init", + "dumb-init", "--dumb-init", "--", os.getenv('NODE_BIN_PATH', 'node'),