Skip to content

Commit

Permalink
fix subprocess remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Nov 23, 2023
1 parent fc068b7 commit 364a24a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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/*
Expand All @@ -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

2 changes: 1 addition & 1 deletion src/screenshotter/puppeteer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 364a24a

Please sign in to comment.