52 lines
1.6 KiB
Docker
52 lines
1.6 KiB
Docker
FROM debian:13-slim
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG UBLOCK_VERSION=1.69.0
|
|
ARG PATCHRIGHT_VERSION=1.58.2
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
file \
|
|
python3 \
|
|
python3-venv \
|
|
python3-pip \
|
|
zip \
|
|
xz-utils \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /build
|
|
|
|
RUN python3 -m venv /opt/uv-bootstrap && \
|
|
/opt/uv-bootstrap/bin/pip install --no-cache-dir uv
|
|
|
|
COPY pyproject.toml uv.lock ./
|
|
|
|
RUN UV_CACHE_DIR=/opt/uv-cache \
|
|
UV_PROJECT_ENVIRONMENT=/opt/build-deps \
|
|
/opt/uv-bootstrap/bin/uv sync --frozen --no-dev
|
|
|
|
RUN python3 -m venv /opt/patchright-venv && \
|
|
/opt/patchright-venv/bin/pip install --no-cache-dir "patchright==${PATCHRIGHT_VERSION}" && \
|
|
PLAYWRIGHT_BROWSERS_PATH=/opt/patchright-browsers /opt/patchright-venv/bin/patchright install chrome && \
|
|
ls -la /opt/google/chrome/ && \
|
|
ls -la /opt/patchright-browsers/
|
|
|
|
RUN mkdir -p /opt/assets && \
|
|
curl -fsSL -o /opt/assets/ublock_origin.xpi \
|
|
"https://github.com/gorhill/uBlock/releases/download/${UBLOCK_VERSION}/uBlock0_${UBLOCK_VERSION}.firefox.signed.xpi"
|
|
|
|
RUN curl -fsSL -o /opt/appimagetool.AppImage \
|
|
"https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" && \
|
|
chmod +x /opt/appimagetool.AppImage
|
|
|
|
COPY src/ ./src/
|
|
COPY appimage/ ./appimage/
|
|
COPY extras/extension/ ./extras/extension/
|
|
|
|
RUN cd extras/extension && zip -r /opt/assets/dark-reader.xpi . && cd /build
|
|
|
|
RUN chmod +x ./appimage/build_in_container.sh
|
|
|
|
CMD ["./appimage/build_in_container.sh"]
|