Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (29 loc) · 1.58 KB
/
Copy pathDockerfile
File metadata and controls
33 lines (29 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Builds the Playwright engine (the one the README recommends) into a
# container with its own Chromium — for a CI canary run or a scheduled job,
# not required for local development (`pip install` directly is simpler there).
#
# docker build -t wellfound-scraper .
# docker run --rm -v "$PWD/out:/out" wellfound-scraper \
# --url "https://wellfound.com/role/r/software-engineer" \
# --pages 3 --out /out/software-engineer
#
# Pass --proxy/--twocaptcha-key the same way as running locally, or mount a
# .env at /app/.env — nothing here bakes in a credential.
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt requirements-playwright.txt ./
RUN pip install --no-cache-dir -r requirements.txt -r requirements-playwright.txt \
# Playwright's own apt-get for Chromium's shared-library dependencies —
# not pip packages, so this has to run as a separate, explicit step.
&& playwright install --with-deps chromium
# Every module playwright_scraper.py imports, transitively, plus diff_runs.py
# as a useful companion in the same image. smoke_test.py checks this list
# against the entrypoint's real import graph: an earlier version omitted
# proxy_pool.py, which the engine imports at module level, so the image died
# with ModuleNotFoundError on every invocation INCLUDING `--help` — a broken
# container that nothing in the repo would have noticed.
COPY captcha_solver.py env_config.py fingerprint_client.py output_writer.py \
page_flow.py playwright_scraper.py product_parser.py proxy_pool.py \
diff_runs.py ./
ENTRYPOINT ["python3", "playwright_scraper.py"]
CMD ["--help"]