fix: handle zombie processes

This commit is contained in:
Levi
2025-06-03 15:24:57 +02:00
parent ee8aeed9b1
commit 5a35117299
2 changed files with 9 additions and 4 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ ENV GITHUB_BUILD=${GITHUB_BUILD}\
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests xauth xvfb scrot curl chromium chromium-driver ca-certificates
apt-get install -y --no-install-recommends --no-install-suggests xauth xvfb scrot curl chromium chromium-driver ca-certificates tini
ADD https://astral.sh/uv/install.sh install.sh
RUN sh install.sh && uv --version
@@ -44,4 +44,4 @@ RUN ./test.sh
FROM app
EXPOSE 8191
HEALTHCHECK --interval=15m --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "http://localhost:8191/health" ]
ENTRYPOINT ["uv", "run", "main.py"]
ENTRYPOINT ["/usr/bin/tini", "--", "uv", "run", "main.py"]
+7 -2
View File
@@ -27,14 +27,19 @@ def get_sb(
detail="SOCKS5 proxy with authentication is not supported. Check README for more info.",
)
with SB(
sb_ctx = SB(
uc=True,
headless=USE_HEADLESS,
locale_code="en",
ad_block=True,
proxy=proxy,
) as sb:
)
sb = sb_ctx.__enter__()
try:
yield sb
finally:
sb_ctx.__exit__(None, None, None)
def save_screenshot(sb: BaseCase):