fix(pry): add missing deps (cloudscraper, aiohttp-socks, pyjwt, apify, playwright-stealth), fix docker env var + healthcheck + non-root
This commit is contained in:
parent
c6194ca444
commit
df2fc04f7c
4 changed files with 49 additions and 4 deletions
|
|
@ -25,7 +25,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
libxcomposite1 libxdamage1 libxrandr2 libgbm1 \
|
||||
libpango-1.0-0 libcairo2 libasound2 \
|
||||
tesseract-ocr tesseract-ocr-eng \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
|
||||
|
|
@ -43,9 +42,12 @@ COPY stealth_scripts/ ./stealth_scripts/
|
|||
COPY templates/ ./templates/
|
||||
RUN mkdir -p /app/sessions /root/.pry
|
||||
|
||||
RUN useradd --create-home --shell /bin/bash --uid 1000 pry && chown -R pry:pry /app
|
||||
USER pry
|
||||
|
||||
EXPOSE 8002
|
||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD curl -sf http://localhost:8002/health || exit 1
|
||||
CMD python3 -c "import urllib.request, sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8002/health', timeout=2).status == 200 else 1)" || exit 1
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8002", \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue