From c5da3c1f220ce4bd43a6fbb5cd0813757bffe316 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 3 Oct 2024 18:24:27 -0700 Subject: [PATCH] fix docker build --- Dockerfile | 16 ++++++++++++++++ archivebox/__main__.py | 18 +++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index a032fe41..0b218e9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,6 +71,7 @@ ENV CODE_DIR=/app \ DATA_DIR=/data \ GLOBAL_VENV=/venv \ PLAYWRIGHT_BROWSERS_PATH=/browsers + # TODO: add TMP_DIR and LIB_DIR? # Application-level paths ENV APP_VENV=/app/.venv \ @@ -201,6 +202,21 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$T && echo -e '\n\n' \ ) | tee -a /VERSION.txt +# Install sonic search +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT \ + echo "[+] Installing Sonic search binary using apt..." \ + && echo "deb [signed-by=/usr/share/keyrings/sonic.gpg] https://packagecloud.io/valeriansaliou/sonic/debian/ bookworm main" > /etc/apt/sources.list.d/sonic.list \ + && curl -fsSL 'https://packagecloud.io/valeriansaliou/sonic/gpgkey' | gpg --dearmor -o /usr/share/keyrings/sonic.gpg \ + && apt-get update -qq \ + && apt-get install -qq -y -t bookworm --no-upgrade sonic \ + && rm -rf /var/lib/apt/lists/* \ + # Save version info + && ( \ + which sonic && sonic --version \ + && echo -e '\n\n' \ + ) | tee -a /VERSION.txt +COPY --chown=root:root --chmod=755 "etc/sonic.cfg" /etc/sonic.cfg + # Install chromium browser using playwright RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT --mount=type=cache,target=/root/.cache/pip,sharing=locked,id=pip-$TARGETARCH$TARGETVARIANT --mount=type=cache,target=/root/.cache/ms-playwright,sharing=locked,id=browsers-$TARGETARCH$TARGETVARIANT \ echo "[+] Installing Browser binary dependencies to $PLAYWRIGHT_BROWSERS_PATH..." \ diff --git a/archivebox/__main__.py b/archivebox/__main__.py index 44604541..afcf86e9 100755 --- a/archivebox/__main__.py +++ b/archivebox/__main__.py @@ -1,19 +1,19 @@ #!/usr/bin/env python3 - -# _ _ _ ____ -# / \ _ __ ___| |__ (_)_ _____| __ ) _____ __ -# / _ \ | '__/ __| '_ \| \ \ / / _ \ _ \ / _ \ \/ / -# / ___ \| | | (__| | | | |\ V / __/ |_) | (_) > < -# /_/ \_\_| \___|_| |_|_| \_/ \___|____/ \___/_/\_\ - - +"""This is the main entry point for the ArchiveBox CLI.""" __package__ = 'archivebox' -import archivebox # noqa +import archivebox # noqa # import archivebox/__init__.py to apply monkey patches, load vendored libs, etc. import sys from .cli import main +ASCII_LOGO_MINI = r""" + _ _ _ ____ + / \ _ __ ___| |__ (_)_ _____| __ ) _____ __ + / _ \ | '__/ __| '_ \| \ \ / / _ \ _ \ / _ \ \/ / + / ___ \| | | (__| | | | |\ V / __/ |_) | (_) > < + /_/ \_\_| \___|_| |_|_| \_/ \___|____/ \___/_/\_\ +""" if __name__ == '__main__': main(args=sys.argv[1:], stdin=sys.stdin)