mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-12 22:25:44 -04:00
fix docker build to use user-local npm dir and not package.json
Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Deploy static content to Pages / deploy (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Deploy static content to Pages / deploy (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
This commit is contained in:
parent
f6446a141f
commit
df544d00dc
2 changed files with 19 additions and 12 deletions
29
Dockerfile
29
Dockerfile
|
@ -72,14 +72,11 @@ ENV ARCHIVEBOX_USER="archivebox" \
|
||||||
# Global paths
|
# Global paths
|
||||||
ENV CODE_DIR=/app \
|
ENV CODE_DIR=/app \
|
||||||
DATA_DIR=/data \
|
DATA_DIR=/data \
|
||||||
GLOBAL_VENV=/venv \
|
|
||||||
SYSTEM_LIB_DIR=/usr/share/archivebox \
|
|
||||||
SYSTEM_TMP_DIR=/tmp/archivebox \
|
|
||||||
PLAYWRIGHT_BROWSERS_PATH=/browsers
|
PLAYWRIGHT_BROWSERS_PATH=/browsers
|
||||||
|
# GLOBAL_VENV=/venv \
|
||||||
# TODO: add TMP_DIR and LIB_DIR?
|
# TODO: add TMP_DIR and LIB_DIR?
|
||||||
|
|
||||||
# Build shell config
|
# Build shell config
|
||||||
# ENV PATH="$SYSTEM_LIB_DIR/bin:$GLOBAL_VENV/bin:$PATH"
|
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-o", "errtrace", "-o", "nounset", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-o", "errtrace", "-o", "nounset", "-c"]
|
||||||
|
|
||||||
######### System Environment ####################################
|
######### System Environment ####################################
|
||||||
|
@ -243,15 +240,25 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$T
|
||||||
) | tee -a /VERSION.txt
|
) | tee -a /VERSION.txt
|
||||||
|
|
||||||
# Install Node dependencies
|
# Install Node dependencies
|
||||||
WORKDIR "$SYSTEM_LIB_DIR/npm"
|
ENV PATH="/home/$ARCHIVEBOX_USER/.local/bin:$PATH"
|
||||||
COPY "etc/package.json" "$SYSTEM_LIB_DIR/npm"
|
USER $ARCHIVEBOX_USER
|
||||||
RUN --mount=type=cache,target=/root/.npm,sharing=locked,id=npm-$TARGETARCH$TARGETVARIANT \
|
RUN --mount=type=cache,target=/home/$ARCHIVEBOX_USER/.npm,sharing=locked,id=npm-$TARGETARCH$TARGETVARIANT,uid=$DEFAULT_PUID,gid=$DEFAULT_PGID \
|
||||||
echo "[+] Installing NPM extractor dependencies from package.json..." \
|
echo "[+] Installing NPM extractor dependencies globally..." \
|
||||||
&& npm install --prefix="$SYSTEM_LIB_DIR/npm" --prefer-offline --no-fund --no-audit --cache /root/.npm \
|
&& npm config set prefix '~/.local/' \
|
||||||
&& chown -R "$DEFAULT_PUID:$DEFAULT_PGID" "$SYSTEM_LIB_DIR" \
|
&& npm install --global --prefer-offline --no-fund --no-audit --cache /home/$ARCHIVEBOX_USER/.npm \
|
||||||
&& ( \
|
"@postlight/parser@^2.2.3" \
|
||||||
|
"readability-extractor@github:ArchiveBox/readability-extractor" \
|
||||||
|
"single-file-cli@^1.1.54" \
|
||||||
|
"puppeteer@^23.5.0" \
|
||||||
|
"@puppeteer/browsers@^2.4.0"
|
||||||
|
USER root
|
||||||
|
RUN ( \
|
||||||
which node && node --version \
|
which node && node --version \
|
||||||
&& which npm && npm version \
|
&& which npm && npm version \
|
||||||
|
&& which postlight-parser \
|
||||||
|
&& which readability-extractor && readability-extractor --version \
|
||||||
|
&& which single-file && single-file --version \
|
||||||
|
&& which puppeteer && puppeteer --version \
|
||||||
&& echo -e '\n\n' \
|
&& echo -e '\n\n' \
|
||||||
) | tee -a /VERSION.txt
|
) | tee -a /VERSION.txt
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "archivebox"
|
name = "archivebox"
|
||||||
version = "0.8.5rc20"
|
version = "0.8.5rc21"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
description = "Self-hosted internet archiving solution."
|
description = "Self-hosted internet archiving solution."
|
||||||
authors = [{name = "Nick Sweeting", email = "pyproject.toml@archivebox.io"}]
|
authors = [{name = "Nick Sweeting", email = "pyproject.toml@archivebox.io"}]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue