2024-12-10 22:16:30 +00:00
|
|
|
FROM debian:bullseye-slim AS base
|
2024-10-18 13:30:00 +00:00
|
|
|
|
2025-02-27 23:16:34 +00:00
|
|
|
ARG GITHUB_BUILD=false \
|
2025-02-27 19:42:32 +00:00
|
|
|
VERSION
|
2024-10-27 18:46:19 +00:00
|
|
|
|
2025-02-27 23:16:34 +00:00
|
|
|
ENV HOME=/root \
|
|
|
|
GITHUB_BUILD=${GITHUB_BUILD}\
|
|
|
|
VERSION=${VERSION}\
|
2024-07-25 00:04:00 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
2024-07-24 15:52:30 +00:00
|
|
|
# prevents python creating .pyc files
|
|
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
2024-10-18 13:30:00 +00:00
|
|
|
DISPLAY=:0
|
2025-02-27 23:16:34 +00:00
|
|
|
ENV PATH="${HOME}/.local/bin:$PATH"
|
2024-07-24 15:52:30 +00:00
|
|
|
|
2024-11-24 22:00:58 +00:00
|
|
|
WORKDIR /app
|
2025-02-20 21:34:07 +00:00
|
|
|
|
2025-02-27 20:31:37 +00:00
|
|
|
RUN apt update &&\
|
2025-02-27 23:29:47 +00:00
|
|
|
apt install -y --no-install-recommends --no-install-suggests xauth xvfb scrot wget chromium chromium-driver ca-certificates
|
2025-02-27 20:31:37 +00:00
|
|
|
|
2025-02-27 23:28:23 +00:00
|
|
|
ADD https://astral.sh/uv/install.sh install.sh
|
|
|
|
RUN sh install.sh
|
2024-12-10 22:16:30 +00:00
|
|
|
COPY pyproject.toml uv.lock ./
|
2024-12-10 22:48:35 +00:00
|
|
|
RUN uv sync
|
2024-07-24 15:52:30 +00:00
|
|
|
|
2025-02-20 21:20:28 +00:00
|
|
|
# SeleniumBase does not come with an arm64 chromedriver binary
|
|
|
|
RUN cd .venv/lib/*/site-packages/seleniumbase/drivers && ln -s /usr/bin/chromedriver uc_driver
|
|
|
|
|
2024-09-13 18:28:36 +00:00
|
|
|
COPY . .
|
2025-01-02 12:29:10 +00:00
|
|
|
|
2024-12-10 22:16:30 +00:00
|
|
|
FROM base AS test
|
|
|
|
|
|
|
|
RUN uv sync --group test
|
2024-12-11 00:21:07 +00:00
|
|
|
RUN ./test.sh
|
2024-12-10 22:16:30 +00:00
|
|
|
|
|
|
|
FROM base
|
|
|
|
|
|
|
|
EXPOSE 8191
|
2025-02-20 20:36:25 +00:00
|
|
|
HEALTHCHECK --interval=15m --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "http://localhost:8191/health" ]
|
2024-11-25 09:26:14 +00:00
|
|
|
CMD ["./cmd.sh"]
|