2020-06-25 21:46:11 +00:00
|
|
|
# This is the Dockerfile for ArchiveBox, it includes the following major pieces:
|
|
|
|
# git, curl, wget, python3, youtube-dl, google-chrome-stable, ArchiveBox
|
2019-02-28 19:04:37 +00:00
|
|
|
# Usage:
|
2020-06-25 21:46:11 +00:00
|
|
|
# docker build . -t archivebox:latest
|
2020-06-26 01:30:29 +00:00
|
|
|
# docker run -v=$PWD/data:/data archivebox:latest archivebox init
|
|
|
|
# echo 'https://example.com' | docker run -v=$PWD/data:/data -i archivebox:latest archivebox add
|
2019-02-28 19:04:37 +00:00
|
|
|
# Documentation:
|
|
|
|
# https://github.com/pirate/ArchiveBox/wiki/Docker#docker
|
|
|
|
|
2020-06-25 21:46:11 +00:00
|
|
|
FROM python:3.8-slim-buster
|
2019-07-09 17:05:51 +00:00
|
|
|
|
2020-06-25 21:46:11 +00:00
|
|
|
LABEL name="archivebox" \
|
|
|
|
maintainer="Nick Sweeting <archivebox-git@sweeting.me>" \
|
|
|
|
description="All-in-one personal internet archiving container"
|
2018-10-14 02:47:30 +00:00
|
|
|
|
2020-06-26 01:30:29 +00:00
|
|
|
ENV TZ=UTC \
|
2020-06-25 21:46:11 +00:00
|
|
|
LANGUAGE=en_US:en \
|
|
|
|
LC_ALL=C.UTF-8 \
|
2020-06-26 01:30:29 +00:00
|
|
|
LANG=C.UTF-8 \
|
2020-06-25 21:46:11 +00:00
|
|
|
PYTHONIOENCODING=UTF-8 \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 \
|
|
|
|
CODE_PATH=/app \
|
|
|
|
VENV_PATH=/venv \
|
|
|
|
DATA_PATH=/data
|
2018-10-14 02:47:30 +00:00
|
|
|
|
2020-06-26 01:30:29 +00:00
|
|
|
# First install CLI utils and base deps, then Chrome + Fons
|
2020-06-25 21:46:11 +00:00
|
|
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
|
|
|
&& apt-get update -qq \
|
|
|
|
&& apt-get install -qq -y --no-install-recommends \
|
2020-06-26 01:30:29 +00:00
|
|
|
apt-transport-https ca-certificates apt-utils gnupg gnupg2 libgconf-2-4 zlib1g-dev \
|
|
|
|
dumb-init jq git wget curl youtube-dl ffmpeg \
|
|
|
|
&& curl -sSL "https://dl.google.com/linux/linux_signing_key.pub" | apt-key add - \
|
2020-06-25 21:46:11 +00:00
|
|
|
&& echo "deb https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
|
2020-06-26 01:30:29 +00:00
|
|
|
&& apt-get update -qq \
|
2020-06-25 21:46:11 +00:00
|
|
|
&& apt-get install -qq -y --no-install-recommends \
|
|
|
|
google-chrome-stable \
|
|
|
|
fontconfig \
|
|
|
|
fonts-ipafont-gothic \
|
|
|
|
fonts-wqy-zenhei \
|
|
|
|
fonts-thai-tlwg \
|
|
|
|
fonts-kacst \
|
|
|
|
fonts-symbola \
|
|
|
|
fonts-noto \
|
|
|
|
fonts-freefont-ttf \
|
2018-10-14 02:47:30 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2020-06-26 01:30:29 +00:00
|
|
|
&& pip install --upgrade --no-cache-dir pip setuptools
|
2019-01-23 06:06:47 +00:00
|
|
|
|
2020-06-26 01:30:29 +00:00
|
|
|
# Run everything from here on out as non-privileged user
|
|
|
|
RUN groupadd --system archivebox \
|
2020-07-09 15:35:33 +00:00
|
|
|
&& useradd --system --create-home --gid archivebox --groups audio,video archivebox
|
2020-04-23 01:13:49 +00:00
|
|
|
|
2020-06-25 21:46:11 +00:00
|
|
|
ADD . "$CODE_PATH"
|
2020-06-26 01:30:29 +00:00
|
|
|
WORKDIR "$CODE_PATH"
|
2020-06-25 21:46:11 +00:00
|
|
|
ENV PATH="$VENV_PATH/bin:${PATH}"
|
2020-06-26 01:30:29 +00:00
|
|
|
RUN python -m venv --clear --symlinks "$VENV_PATH" \
|
|
|
|
&& pip install -e .
|
2018-10-14 02:47:30 +00:00
|
|
|
|
2020-06-25 21:46:11 +00:00
|
|
|
VOLUME "$DATA_PATH"
|
2020-06-26 01:30:29 +00:00
|
|
|
WORKDIR "$DATA_PATH"
|
|
|
|
USER archivebox:archivebox
|
|
|
|
EXPOSE 8000
|
2020-06-25 21:46:11 +00:00
|
|
|
ENV CHROME_BINARY=google-chrome \
|
2020-06-26 01:30:29 +00:00
|
|
|
CHROME_SANDBOX=False
|
2018-10-14 02:47:30 +00:00
|
|
|
|
2020-06-25 21:46:11 +00:00
|
|
|
RUN archivebox version
|
2018-10-14 02:47:30 +00:00
|
|
|
|
2020-06-26 01:30:29 +00:00
|
|
|
ENTRYPOINT ["dumb-init", "--", "archivebox"]
|
|
|
|
CMD ["server", "0.0.0.0:8000"]
|