From 8cbfc253abdf64a6b9beceddee3e1941a4e0fe33 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Tue, 23 Feb 2021 16:34:34 +0100 Subject: [PATCH] archivebox image --- Makefile | 5 +++- README.md | 5 +++- archivebox/Dockerfile | 56 ++++++++++++++++++++++++++++++++++++++++ archivebox/Makefile | 10 +++++++ archivebox/entrypoint.sh | 5 ++++ 5 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 archivebox/Dockerfile create mode 100644 archivebox/Makefile create mode 100644 archivebox/entrypoint.sh diff --git a/Makefile b/Makefile index dc9d77b..fcc7a91 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -images=agate ansible backup buku ddclient git-daemon gitolite gitolite-pystagit rss-bridge sassc syncthing tasks tor vdirsyncer xandikos +images=agate archivebox ansible backup buku ddclient git-daemon gitolite gitolite-pystagit rss-bridge sassc syncthing tasks tor vdirsyncer xandikos .PHONY: all $(images) all: $(images) @@ -7,6 +7,9 @@ BUILD = make -C $@ agate: $(BUILD) +archivebox: + $(BUILD) + ansible: $(BUILD) diff --git a/README.md b/README.md index 849b611..2955f9a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ Collection of docker images for my personal use. I usually implement my own docker images if I don't find one built or recommended by the original -developer of the software I intend to run. +developer of the software I intend to run. Or if the recommended one is too +complex for my specific use case. Or if I don't like it for whatever reason. Or +if I just feel like making my own image. Simply run `make $IMG_NAME` to build a specific image or run `make` to build them all. @@ -16,6 +18,7 @@ useful. (many are self-explanatory) * agate +* archivebox * ansible * backup: simple image used in some of my backup daemons * buku: buku and bukuserver diff --git a/archivebox/Dockerfile b/archivebox/Dockerfile new file mode 100644 index 0000000..03c9c43 --- /dev/null +++ b/archivebox/Dockerfile @@ -0,0 +1,56 @@ +FROM alpine:3.13 + +COPY entrypoint.sh /usr/local/bin/entrypoint + +RUN apk add --no-cache --virtual .build-deps \ + gcc \ + python3-dev \ + npm \ + musl-dev && \ + apk add --no-cache \ + py3-pip \ + python3 \ + curl \ + nodejs \ + git \ + chromium \ + youtube-dl \ + ripgrep \ + wget && \ + pip3 install --upgrade pip setuptools && \ + pip3 install --upgrade archivebox && \ + npm install -g 'git+https://github.com/ArchiveBox/ArchiveBox.git' && \ + apk del .build-deps && \ + addgroup --gid 10001 archivebox && \ + adduser \ + --uid 10000 \ + --home /var/lib/archivebox \ + --ingroup archivebox \ + --disabled-password \ + --shell /sbin/nologin \ + archivebox && \ + mkdir -p /data && \ + mkdir -p /var/lib/archivebox/chromium_data/Default && \ + touch /var/lib/archivebox/cookies.txt && \ + chown -R archivebox /data /var/lib/archivebox && \ + chmod +x /usr/local/bin/entrypoint + +ENV IN_DOCKER=True \ + CHROME_SANDBOX=False \ + CHROME_BINARY="/usr/bin/chromium-browser" \ + CHROME_USER_DATA_DIR="/var/lib/archivebox/chromium_data" \ + COOKIES_FILE="/var/lib/archivebox/cookies.txt" \ + USE_SINGLEFILE=True \ + SINGLEFILE_BINARY="/usr/bin/single-file" \ + USE_READABILITY=True \ + READABILITY_BINARY="/usr/bin/readability-extractor" \ + USE_MERCURY=True \ + MERCURY_BINARY="/usr/bin/mercury-parser" + +VOLUME /data +EXPOSE 8000 + +WORKDIR /data +USER archivebox +ENTRYPOINT ["/usr/local/bin/entrypoint"] +CMD ["server", "0.0.0.0:8000"] diff --git a/archivebox/Makefile b/archivebox/Makefile new file mode 100644 index 0000000..959b564 --- /dev/null +++ b/archivebox/Makefile @@ -0,0 +1,10 @@ +USERNAME = rilla +IMG_NAME = archivebox + +.PHONY: build build-nc + +build: Dockerfile + docker build -t $(USERNAME)/$(IMG_NAME) . + +build-nc: Dockerfile + docker build --no-cache -t $(USERNAME)/$(IMG_NAME) . diff --git a/archivebox/entrypoint.sh b/archivebox/entrypoint.sh new file mode 100644 index 0000000..d932701 --- /dev/null +++ b/archivebox/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +archivebox init + +exec archivebox "$@"