Byparr/Dockerfile

37 lines
925 B
Docker
Raw Normal View History

2024-12-10 22:16:30 +00:00
FROM debian:bullseye-slim AS base
2024-10-18 13:30:00 +00:00
# Inspired by https://github.com/Hudrolax/uc-docker-alpine/
2024-10-27 18:46:19 +00:00
ARG GITHUB_BUILD=false
ENV GITHUB_BUILD=${GITHUB_BUILD}
2024-11-24 22:00:58 +00:00
ENV HOME=/root
2024-07-25 00:04:00 +00:00
ENV \
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
2024-07-24 15:52:30 +00:00
2024-11-24 22:00:58 +00:00
WORKDIR /app
2024-11-24 22:13:47 +00:00
RUN apt update &&\
apt install -y xvfb scrot python3-tk curl chromium chromium-driver
2024-11-24 22:00:58 +00:00
2024-12-10 22:16:30 +00:00
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
2024-11-24 22:00:58 +00:00
ENV PATH="${HOME}/.local/bin:$PATH"
2024-12-10 22:16:30 +00:00
COPY pyproject.toml uv.lock ./
RUN uv sync --no-group
2024-07-24 15:52:30 +00:00
2024-09-13 18:28:36 +00:00
COPY . .
2024-11-30 11:38:48 +00:00
RUN cd .venv/lib/*/site-packages/seleniumbase/drivers && ln -s /usr/bin/chromedriver uc_driver
2024-12-10 22:16:30 +00:00
FROM base AS test
RUN uv sync --group test
RUN uv run pytest --retries 2 -n auto --xvfb
FROM base
EXPOSE 8191
HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "http://localhost:8191/health" ]
2024-11-25 09:26:14 +00:00
CMD ["./cmd.sh"]