1
0
Files
xactfetch/Containerfile
Dustin C. Hatch 9f113d6a3f xactfetch: Switch to headed Chrome
Earlier this week, `xactfetch` stopped being able to log in to the Chase
website.  After logging in, the website just popped up a message that
said "It looks like this part of our website isn't working right now,"
with a hint that I should try a different browser.  I suspect they have
enhanced their bot detection/scraping resistance, because the error
only occurs when `xactfetch` is run from inside a container.  It happens
every time in that case, but never when I run it on my computer
directly.

After several hours of messing with this, the only way I was able to
get it to work is to use full-blown headed Chromium.  Neither headless
nor headed Firefox works, nor does headless Chromium.  This is a bit
cumbersome, but not really a big deal.  Headed Chromium works fine in
an Xvfb session.
2024-07-11 21:34:11 -05:00

81 lines
1.6 KiB
Docker

FROM registry.fedoraproject.org/fedora-minimal:38 AS build
RUN --mount=type=cache,target=/var/cache \
microdnf install -y \
--setopt install_weak_deps=0 \
rust \
cargo \
&& :
RUN cargo install rbw
RUN --mount=type=cache,target=/var/cache \
microdnf install -y \
--setopt install_weak_deps=0 \
git-core \
python3-devel \
python3-pip \
python3-wheel \
&& :
COPY . /src
RUN python3 -m pip wheel -w /wheels /src
FROM registry.fedoraproject.org/fedora-minimal:38
RUN --mount=type=cache,target=/var/cache \
microdnf install -y \
--setopt install_weak_deps=0 \
alsa-lib \
atk \
cairo \
cairo-gobject \
dbus-glib \
fontconfig \
freetype \
gdk-pixbuf2 \
gtk3 \
libX11 \
libX11-xcb \
libXcomposite \
libXcursor \
libXdamage \
libXext \
libXfixes \
libXi \
libXrandr \
libXrender \
libXtst \
libdrm \
libxcb \
mesa-libgbm \
nspr \
nss \
pango \
python3 \
python3-pip \
tini \
xorg-x11-server-Xvfb \
&& echo xactfetch:x:2468: >> /etc/group \
&& echo xactfetch:*:2468:2468:xactfetch:/var/lib/xactfetch:/sbin/nologin >> /etc/passwd \
&& :
ENV PLAYWRIGHT_BROWSERS_PATH=/usr/local/playwright/browsers
RUN --mount=type=bind,from=build,source=/,target=/build \
python3 -m pip install --no-index -f /build/wheels xactfetch \
&& cp /build/root/.cargo/bin/rbw* /usr/local/bin/ \
&& install /build/src/pinentry-stub.sh /usr/local/bin/pinentry-stub \
&& install /build/src/entrypoint.sh /entrypoint.sh \
&& playwright install chromium \
&& :
VOLUME /var/lib/xactfetch
WORKDIR /var/lib/xactfetch
USER 2468:2468
ENTRYPOINT ["tini", "/entrypoint.sh", "--"]