forked from ThePhaseless/Byparr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (28 loc) · 986 Bytes
/
Dockerfile
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
FROM debian:bullseye-slim AS base
# Inspired by https://github.com/Hudrolax/uc-docker-alpine/
ARG GITHUB_BUILD=false
ENV GITHUB_BUILD=${GITHUB_BUILD}
ENV HOME=/root
ENV \
DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
# prevents python creating .pyc files
PYTHONDONTWRITEBYTECODE=1 \
PATH="${HOME}/.local/bin:$PATH" \
DISPLAY=:0
WORKDIR /app
RUN apt update &&\
apt upgrade -y &&\
apt install -y --no-install-recommends --no-install-suggests xauth xvfb scrot python3-tk curl chromium chromium-driver ca-certificates x11-common
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
COPY pyproject.toml uv.lock ./
RUN uv sync
COPY . .
RUN cd .venv/lib/*/site-packages/seleniumbase/drivers && ln -s /usr/bin/chromedriver uc_driver
FROM base AS test
RUN uv sync --group test
RUN ./test.sh
FROM base
EXPOSE 8191
HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "http://localhost:8191/health" ]
CMD ["./cmd.sh"]