Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (45 loc) · 2.56 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (45 loc) · 2.56 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Builds the Playwright engine (the one the README recommends) into a
# container with REAL CHROME — see below for why that word is load-bearing.
#
# docker build -t vrbo-scraper .
# docker run --rm -v "$PWD/out:/out" vrbo-scraper \
# --url "https://www.vrbo.com/search?destination=Orlando,%20Florida,%20United%20States%20of%20America" \
# --pages 3 --out /out/orlando
#
# Pass --proxy/--twocaptcha-key the same way as running locally, or mount a
# .env at /app/.env — nothing here bakes in a credential, and .dockerignore
# keeps one out of the build context.
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt requirements-playwright.txt ./
# `playwright install chrome` rather than `chromium`: a real browser is the
# more faithful client, and it matches this repo's default channel so the
# image behaves like a local run.
#
# It is NOT the difference between an image that works and one that does not
# — measured 2026-09-14, the two builds interleaved on a clean address, six
# requests each, 12 of 12 served. What decides access is how the exit address
# is scored. An earlier version of this comment claimed otherwise.
#
# `--with-deps` also pulls Chromium's shared-library dependencies through
# apt, which are not pip packages and so cannot ride in requirements.txt.
RUN pip install --no-cache-dir -r requirements.txt -r requirements-playwright.txt \
&& playwright install --with-deps chrome
# 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: three repos in this family
# shipped an image missing proxy_pool.py, which the engine imports at module
# level, so it 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 ./
# Headful by default everywhere else in this repo; in a container there is no
# display, so the engine runs headless here. That is a real limitation rather
# than a preference — the measured discriminator on this site is the browser
# BUILD rather than the window, which is why installing chrome above is what
# matters, but a headless run is one more thing a bot manager can key on.
# Pass --proxy or --cdp-endpoint if this image starts getting refused.
ENV VRBO_DOCKER=1
ENTRYPOINT ["python3", "playwright_scraper.py", "--headless"]
CMD ["--help"]