Dockerfile 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. # This is the Dockerfile for ArchiveBox, it bundles the following main dependencies:
  2. # python3.14, pip, pipx, uv, python3-ldap
  3. # curl, wget, git, dig, ping, tree, nano
  4. # node, npm, single-file, readability-extractor, postlight-parser
  5. # ArchiveBox, yt-dlp, playwright, chromium
  6. # Usage:
  7. # git clone https://github.com/ArchiveBox/ArchiveBox && cd ArchiveBox
  8. # docker build . -t archivebox
  9. # docker run -v "$PWD/data":/data archivebox init
  10. # docker run -v "$PWD/data":/data archivebox add 'https://example.com'
  11. # docker run -v "$PWD/data":/data -it archivebox manage createsuperuser
  12. # docker run -v "$PWD/data":/data -p 8000:8000 archivebox server
  13. # Multi-arch build:
  14. # docker buildx create --use
  15. # docker buildx build . --platform=linux/amd64,linux/arm64--push -t archivebox/archivebox:dev -t archivebox/archivebox:sha-abc123
  16. # Read more here: https://github.com/ArchiveBox/ArchiveBox#archivebox-development
  17. #########################################################################################
  18. ### Example: Using ArchiveBox in your own project's Dockerfile ########
  19. # FROM python:3.14-slim
  20. # WORKDIR /data
  21. # RUN pip install archivebox>=0.8.5rc51 # use latest release here
  22. # RUN archivebox install
  23. # RUN useradd -ms /bin/bash archivebox && chown -R archivebox /data
  24. #########################################################################################
  25. FROM ubuntu:24.04
  26. LABEL name="archivebox" \
  27. maintainer="Nick Sweeting <[email protected]>" \
  28. description="All-in-one self-hosted internet archiving solution" \
  29. homepage="https://github.com/ArchiveBox/ArchiveBox" \
  30. documentation="https://github.com/ArchiveBox/ArchiveBox/wiki/Docker" \
  31. org.opencontainers.image.title="ArchiveBox" \
  32. org.opencontainers.image.vendor="ArchiveBox" \
  33. org.opencontainers.image.description="All-in-one self-hosted internet archiving solution" \
  34. org.opencontainers.image.source="https://github.com/ArchiveBox/ArchiveBox" \
  35. com.docker.image.source.entrypoint="Dockerfile" \
  36. # TODO: release ArchiveBox as a Docker Desktop extension (requires these labels):
  37. # https://docs.docker.com/desktop/extensions-sdk/architecture/metadata/
  38. com.docker.desktop.extension.api.version=">= 1.4.7" \
  39. com.docker.desktop.extension.icon="https://archivebox.io/icon.png" \
  40. com.docker.extension.publisher-url="https://archivebox.io" \
  41. com.docker.extension.screenshots='[{"alt": "Screenshot of Admin UI", "url": "https://github.com/ArchiveBox/ArchiveBox/assets/511499/e8e0b6f8-8fdf-4b7f-8124-c10d8699bdb2"}]' \
  42. com.docker.extension.detailed-description='See here for detailed documentation: https://wiki.archivebox.io' \
  43. com.docker.extension.changelog='See here for release notes: https://github.com/ArchiveBox/ArchiveBox/releases' \
  44. com.docker.extension.categories='database,utility-tools'
  45. ARG TARGETPLATFORM
  46. ARG TARGETOS
  47. ARG TARGETARCH
  48. ARG TARGETVARIANT
  49. ######### Environment Variables #################################
  50. # Global built-time and runtime environment constants + default pkg manager config
  51. ENV TZ=UTC \
  52. LANGUAGE=en_US:en \
  53. LC_ALL=C.UTF-8 \
  54. LANG=C.UTF-8 \
  55. DEBIAN_FRONTEND=noninteractive \
  56. APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 \
  57. PYTHONIOENCODING=UTF-8 \
  58. PYTHONUNBUFFERED=1 \
  59. PIP_DISABLE_PIP_VERSION_CHECK=1 \
  60. npm_config_loglevel=error
  61. # Language Version config
  62. ENV PYTHON_VERSION=3.12 \
  63. NODE_VERSION=22
  64. # Non-root User config
  65. ENV ARCHIVEBOX_USER="archivebox" \
  66. DEFAULT_PUID=911 \
  67. DEFAULT_PGID=911 \
  68. IN_DOCKER=True
  69. # ArchiveBox Source Code + Lib + Data paths
  70. ENV CODE_DIR=/app \
  71. DATA_DIR=/data \
  72. PLAYWRIGHT_BROWSERS_PATH=/browsers
  73. # GLOBAL_VENV=/venv \
  74. # TODO: add TMP_DIR and LIB_DIR?
  75. # Bash SHELL config
  76. # http://redsymbol.net/articles/unofficial-bash-strict-mode/
  77. SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-o", "errtrace", "-o", "nounset", "-c"]
  78. ######### System Environment ####################################
  79. # Detect ArchiveBox version number by reading pyproject.toml (also serves to invalidate the entire build cache whenever pyproject.toml changes)
  80. WORKDIR "$CODE_DIR"
  81. # Force apt to leave downloaded binaries in /var/cache/apt (massively speeds up back-to-back Docker builds)
  82. RUN echo 'Binary::apt::APT::Keep-Downloaded-Packages "1";' > /etc/apt/apt.conf.d/99keep-cache \
  83. && echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/99no-intall-recommends \
  84. && echo 'APT::Install-Suggests "0";' > /etc/apt/apt.conf.d/99no-intall-suggests \
  85. && rm -f /etc/apt/apt.conf.d/docker-clean
  86. # Print debug info about build and save it to disk, for human eyes only, not used by anything else
  87. RUN (echo "[i] Docker build for ArchiveBox starting..." \
  88. && echo "PLATFORM=${TARGETPLATFORM} ARCH=$(uname -m) ($(uname -s) ${TARGETARCH} ${TARGETVARIANT})" \
  89. && echo "BUILD_START_TIME=$(date +"%Y-%m-%d %H:%M:%S %s") TZ=${TZ} LANG=${LANG}" \
  90. && echo \
  91. && echo "PYTHON=${PYTHON_VERSION} NODE=${NODE_VERSION} PATH=${PATH}" \
  92. && echo "CODE_DIR=${CODE_DIR} DATA_DIR=${DATA_DIR}" \
  93. && echo \
  94. && uname -a \
  95. && cat /etc/os-release | head -n7 \
  96. && which bash && bash --version | head -n1 \
  97. && which dpkg && dpkg --version | head -n1 \
  98. && echo -e '\n\n' && env && echo -e '\n\n' \
  99. ) | tee -a /VERSION.txt
  100. # Create non-privileged user for archivebox and chrome
  101. RUN echo "[*] Setting up $ARCHIVEBOX_USER user uid=${DEFAULT_PUID}..." \
  102. && groupadd --system $ARCHIVEBOX_USER \
  103. && useradd --system --create-home --gid $ARCHIVEBOX_USER --groups audio,video $ARCHIVEBOX_USER \
  104. && usermod -u "$DEFAULT_PUID" "$ARCHIVEBOX_USER" \
  105. && groupmod -g "$DEFAULT_PGID" "$ARCHIVEBOX_USER" \
  106. && echo -e "\nARCHIVEBOX_USER=$ARCHIVEBOX_USER PUID=$(id -u $ARCHIVEBOX_USER) PGID=$(id -g $ARCHIVEBOX_USER)\n\n" \
  107. | tee -a /VERSION.txt
  108. # DEFAULT_PUID and DEFAULT_PID are overriden by PUID and PGID in /bin/docker_entrypoint.sh at runtime
  109. # https://docs.linuxserver.io/general/understanding-puid-and-pgid
  110. # Install system apt dependencies (adding backports to access more recent apt updates)
  111. RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT \
  112. echo "[+] APT Installing base system dependencies for $TARGETPLATFORM..." \
  113. && mkdir -p /etc/apt/keyrings \
  114. && apt-get update -qq \
  115. && apt-get install -qq -y \
  116. # 1. packaging dependencies
  117. apt-transport-https ca-certificates apt-utils gnupg2 curl wget \
  118. # 2. docker and init system dependencies
  119. zlib1g-dev dumb-init gosu cron unzip grep dnsutils \
  120. # 3. frivolous CLI helpers to make debugging failed archiving easier
  121. tree nano iputils-ping \
  122. # nano iputils-ping dnsutils htop procps jq yq
  123. && rm -rf /var/lib/apt/lists/*
  124. # Install apt binary dependencies for exractors
  125. # COPY --from=selenium/ffmpeg:latest /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
  126. RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT \
  127. echo "[+] APT Installing extractor dependencies for $TARGETPLATFORM..." \
  128. && apt-get update -qq \
  129. && apt-get install -qq -y --no-install-recommends \
  130. git ripgrep \
  131. # Packages we have also needed in the past:
  132. # youtube-dl wget2 aria2 python3-pyxattr rtmpdump libfribidi-bin mpv \
  133. # curl wget (already installed above)
  134. && rm -rf /var/lib/apt/lists/* \
  135. # Save version info
  136. && ( \
  137. which curl && curl --version | head -n1 \
  138. && which wget && wget --version 2>&1 | head -n1 \
  139. && which git && git --version 2>&1 | head -n1 \
  140. # && which ffmpeg && (ffmpeg --version 2>&1 | head -n1) || true \
  141. && which rg && rg --version 2>&1 | head -n1 \
  142. && echo -e '\n\n' \
  143. ) | tee -a /VERSION.txt
  144. # Install sonic search backend
  145. COPY --from=archivebox/sonic:1.4.9 /usr/local/bin/sonic /usr/local/bin/sonic
  146. COPY --chown=root:root --chmod=755 "etc/sonic.cfg" /etc/sonic.cfg
  147. RUN (which sonic && sonic --version) | tee -a /VERSION.txt
  148. ######### Language Environments ####################################
  149. # Set up Python environment
  150. # NOT NEEDED because we're using a pre-built python image, keeping this here in case we switch back to custom-building our own:
  151. #RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT \
  152. # --mount=type=cache,target=/root/.cache/pip,sharing=locked,id=pip-$TARGETARCH$TARGETVARIANT \
  153. # RUN echo "[+] APT Installing PYTHON $PYTHON_VERSION for $TARGETPLATFORM (skipped, provided by base image)..." \
  154. # && apt-get update -qq \
  155. # && apt-get install -qq -y --no-upgrade \
  156. # python${PYTHON_VERSION} python${PYTHON_VERSION}-minimal python3-pip python${PYTHON_VERSION}-venv pipx \
  157. # && rm -rf /var/lib/apt/lists/* \
  158. # tell PDM to allow using global system python site packages
  159. # && rm /usr/lib/python3*/EXTERNALLY-MANAGED \
  160. # && ln -s "$(which python${PYTHON_VERSION})" /usr/bin/python \
  161. # create global virtual environment GLOBAL_VENV to use (better than using pip install --global)
  162. # && python3 -m venv --system-site-packages --symlinks $GLOBAL_VENV \
  163. # && python3 -m venv --system-site-packages $GLOBAL_VENV \
  164. # && python3 -m venv $GLOBAL_VENV \
  165. # install global dependencies / python build dependencies in GLOBAL_VENV
  166. # && pip install --upgrade pip setuptools wheel \
  167. # Save version info
  168. # && ( \
  169. # which python3 && python3 --version | grep " $PYTHON_VERSION" \
  170. # && which pip && pip --version \
  171. # # && which pdm && pdm --version \
  172. # && echo -e '\n\n' \
  173. # ) | tee -a /VERSION.txt
  174. # Set up Node environment
  175. RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT \
  176. --mount=type=cache,target=/root/.npm,sharing=locked,id=npm-$TARGETARCH$TARGETVARIANT \
  177. echo "[+] APT Installing NODE $NODE_VERSION for $TARGETPLATFORM..." \
  178. && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_VERSION}.x nodistro main" >> /etc/apt/sources.list.d/nodejs.list \
  179. && curl -fsSL "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" | gpg --dearmor | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
  180. && apt-get update -qq \
  181. && apt-get install -qq -y --no-upgrade libatomic1 \
  182. && apt-get install -y --no-upgrade \
  183. nodejs \
  184. && rm -rf /var/lib/apt/lists/* \
  185. # Update NPM to latest version
  186. && npm i -g npm --cache /root/.npm \
  187. # Save version info
  188. && ( \
  189. which node && node --version \
  190. && which npm && npm --version \
  191. && echo -e '\n\n' \
  192. ) | tee -a /VERSION.txt
  193. # Set up uv and main app /venv
  194. COPY --from=ghcr.io/astral-sh/uv:0.5 /uv /uvx /bin/
  195. ENV UV_COMPILE_BYTECODE=1 \
  196. UV_PYTHON_PREFERENCE=only-system \
  197. UV_LINK_MODE=copy \
  198. UV_PROJECT_ENVIRONMENT=/venv
  199. WORKDIR "$CODE_DIR"
  200. # COPY --chown=root:root --chmod=755 pyproject.toml "$CODE_DIR/"
  201. RUN --mount=type=cache,target=/root/.cache/uv,sharing=locked,id=uv-$TARGETARCH$TARGETVARIANT \
  202. echo "[+] UV Creating /venv using python ${PYTHON_VERSION} for ${TARGETPLATFORM} (provided by base image)..." \
  203. && uv python find --system \
  204. && uv venv /venv
  205. ENV VIRTUAL_ENV=/venv PATH="/venv/bin:$PATH"
  206. RUN uv pip install setuptools pip \
  207. && ( \
  208. which python3 && python3 --version \
  209. && which uv && uv version \
  210. && uv python find --system && uv python find \
  211. && echo -e '\n\n' \
  212. ) | tee -a /VERSION.txt
  213. ######### ArchiveBox & Extractor Dependencies ##################################
  214. # Install ArchiveBox C-compiled/apt-installed Python dependencies in app /venv (currently only used for python-ldap)
  215. WORKDIR "$CODE_DIR"
  216. RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT \
  217. --mount=type=cache,target=/root/.cache/uv,sharing=locked,id=uv-$TARGETARCH$TARGETVARIANT \
  218. #--mount=type=cache,target=/root/.cache/pip,sharing=locked,id=pip-$TARGETARCH$TARGETVARIANT \
  219. echo "[+] APT Installing + Compiling python3-ldap for PIP archivebox[ldap] on ${TARGETPLATFORM}..." \
  220. && apt-get update -qq \
  221. && apt-get install -qq -y --no-install-recommends \
  222. build-essential gcc \
  223. python3-dev libssl-dev libldap2-dev libsasl2-dev python3-ldap \
  224. python3-msgpack python3-mutagen python3-regex python3-pycryptodome procps \
  225. && uv pip install \
  226. "python-ldap>=3.4.3" \
  227. && apt-get purge -y \
  228. python3-dev build-essential gcc \
  229. && apt-get autoremove -y \
  230. && rm -rf /var/lib/apt/lists/*
  231. # Install apt font & rendering dependencies for chromium browser
  232. # TODO: figure out how much of this overlaps with `playwright install-deps chromium`
  233. # RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT \
  234. # Install chromium browser binary using playwright
  235. RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$TARGETVARIANT \
  236. --mount=type=cache,target=/root/.cache/ms-playwright,sharing=locked,id=browsers-$TARGETARCH$TARGETVARIANT \
  237. --mount=type=cache,target=/root/.cache/uv,sharing=locked,id=uv-$TARGETARCH$TARGETVARIANT \
  238. echo "[+] APT Installing CHROMIUM dependencies, fonts, and display libraries for $TARGETPLATFORM..." \
  239. && apt-get update -qq \
  240. && apt-get install -qq -y \
  241. #fontconfig fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-symbola fonts-noto fonts-freefont-ttf \
  242. #at-spi2-common fonts-liberation fonts-noto-color-emoji fonts-tlwg-loma-otf fonts-unifont libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libavahi-client3 \
  243. #libavahi-common-data libavahi-common3 libcups2 libfontenc1 libice6 libnspr4 libnss3 libsm6 libunwind8 \
  244. #libxaw7 libxcomposite1 libxdamage1 libxfont2 \
  245. libxkbfile1 libxmu6 libxpm4 libxt6 x11-xkb-utils x11-utils xfonts-encodings \
  246. # xfonts-scalable xfonts-utils xserver-common xvfb \
  247. # chrome can run without dbus/upower technically, it complains about missing dbus but should run ok anyway
  248. # libxss1 dbus dbus-x11 upower \
  249. # && service dbus start \
  250. && echo "[+] PIP Installing playwright into /venv and CHROMIUM binary into $PLAYWRIGHT_BROWSERS_PATH..." \
  251. && uv pip install "playwright>=1.49.1" \
  252. && uv run playwright install chromium --no-shell --with-deps \
  253. && export CHROME_BINARY="$(uv run python -c 'from playwright.sync_api import sync_playwright; print(sync_playwright().start().chromium.executable_path)')" \
  254. && ln -s "$CHROME_BINARY" /usr/bin/chromium-browser \
  255. && ln -s /browsers/ffmpeg-*/ffmpeg-linux /usr/bin/ffmpeg \
  256. && mkdir -p "/home/${ARCHIVEBOX_USER}/.config/chromium/Crash Reports/pending/" \
  257. && chown -R "$DEFAULT_PUID:$DEFAULT_PGID" "/home/${ARCHIVEBOX_USER}/.config" \
  258. && mkdir -p "$PLAYWRIGHT_BROWSERS_PATH" \
  259. && chown -R $ARCHIVEBOX_USER "$PLAYWRIGHT_BROWSERS_PATH" \
  260. # delete extra full copy of node that playwright installs (saves >100mb)
  261. && rm -f /venv/lib/python$PYTHON_VERSION/site-packages/playwright/driver/node \
  262. # Save version info
  263. && rm -rf /var/lib/apt/lists/* \
  264. && ( \
  265. uv pip show playwright \
  266. && which chromium-browser && /usr/bin/chromium-browser --version || /usr/lib/chromium/chromium --version \
  267. && which ffmpeg && ffmpeg -version \
  268. && echo -e '\n\n' \
  269. ) | tee -a /VERSION.txt
  270. # Install Node extractor dependencies
  271. ENV PATH="/home/$ARCHIVEBOX_USER/.npm/bin:$PATH"
  272. USER $ARCHIVEBOX_USER
  273. WORKDIR "/home/$ARCHIVEBOX_USER/.npm"
  274. RUN --mount=type=cache,target=/home/archivebox/.npm_cache,sharing=locked,id=npm-$TARGETARCH$TARGETVARIANT,uid=$DEFAULT_PUID,gid=$DEFAULT_PGID \
  275. echo "[+] NPM Installing node extractor dependencies into /home/$ARCHIVEBOX_USER/.npm..." \
  276. && npm config set prefix "/home/$ARCHIVEBOX_USER/.npm" \
  277. && npm install --global --prefer-offline --no-fund --no-audit --cache "/home/$ARCHIVEBOX_USER/.npm_cache" \
  278. "@postlight/parser@^2.2.3" \
  279. "readability-extractor@github:ArchiveBox/readability-extractor" \
  280. "single-file-cli@^1.1.54" \
  281. "puppeteer@^23.5.0" \
  282. "@puppeteer/browsers@^2.4.0" \
  283. && rm -Rf "/home/$ARCHIVEBOX_USER/.cache/puppeteer"
  284. USER root
  285. WORKDIR "$CODE_DIR"
  286. RUN ( \
  287. which node && node --version \
  288. && which npm && npm version \
  289. && which postlight-parser \
  290. && which readability-extractor && readability-extractor --version \
  291. && which single-file && single-file --version \
  292. && which puppeteer && puppeteer --version \
  293. && echo -e '\n\n' \
  294. ) | tee -a /VERSION.txt
  295. ######### Build Dependencies ####################################
  296. # Install ArchiveBox Python venv dependencies from uv.lock
  297. RUN --mount=type=bind,source=pyproject.toml,target=/app/pyproject.toml \
  298. --mount=type=bind,source=uv.lock,target=/app/uv.lock \
  299. --mount=type=cache,target=/root/.cache/uv,sharing=locked,id=uv-$TARGETARCH$TARGETVARIANT \
  300. echo "[+] PIP Installing ArchiveBox dependencies from pyproject.toml and uv.lock..." \
  301. && uv sync \
  302. --frozen \
  303. --inexact \
  304. --all-extras \
  305. --no-install-project \
  306. --no-install-workspace
  307. # installs the pip packages that archivebox depends on, defined in pyproject.toml and uv.lock dependencies
  308. # Install ArchiveBox Python package + workspace dependencies from source
  309. COPY --chown=root:root --chmod=755 "." "$CODE_DIR/"
  310. RUN --mount=type=cache,target=/root/.cache/uv,sharing=locked,id=uv-$TARGETARCH$TARGETVARIANT \
  311. echo "[*] Installing ArchiveBox Python source code from $CODE_DIR..." \
  312. && uv sync \
  313. --frozen \
  314. --inexact \
  315. --all-extras \
  316. && ( \
  317. uv tree \
  318. && which archivebox \
  319. && echo -e '\n\n' \
  320. ) | tee -a /VERSION.txt
  321. # installs archivebox itself, and any other vendored packages in pkgs/*, defined in pyproject.toml workspaces
  322. ####################################################
  323. # Setup ArchiveBox runtime config
  324. ENV TMP_DIR=/tmp/archivebox \
  325. LIB_DIR=/usr/share/archivebox/lib \
  326. GOOGLE_API_KEY=no \
  327. GOOGLE_DEFAULT_CLIENT_ID=no \
  328. GOOGLE_DEFAULT_CLIENT_SECRET=no
  329. WORKDIR "$DATA_DIR"
  330. RUN openssl rand -hex 16 > /etc/machine-id \
  331. && mkdir -p "$TMP_DIR" \
  332. && chown -R "$DEFAULT_PUID:$DEFAULT_PGID" "$TMP_DIR" \
  333. && mkdir -p "$LIB_DIR" \
  334. && chown -R "$DEFAULT_PUID:$DEFAULT_PGID" "$LIB_DIR" \
  335. && echo -e "\nTMP_DIR=$TMP_DIR\nLIB_DIR=$LIB_DIR\nMACHINE_ID=$(cat /etc/machine-id)\n" | tee -a /VERSION.txt
  336. # Print version for nice docker finish summary
  337. RUN (echo -e "\n\n[√] Finished Docker build succesfully. Saving build summary in: /VERSION.txt" \
  338. && echo -e "PLATFORM=${TARGETPLATFORM} ARCH=$(uname -m) ($(uname -s) ${TARGETARCH} ${TARGETVARIANT})\n" \
  339. && echo -e "BUILD_END_TIME=$(date +"%Y-%m-%d %H:%M:%S %s")\n\n" \
  340. ) | tee -a /VERSION.txt
  341. # Run $ archivebox version >> /VERSION.txt
  342. # RUN "$CODE_DIR"/bin/docker_entrypoint.sh init 2>&1 | tee -a /VERSION.txt
  343. RUN "$CODE_DIR"/bin/docker_entrypoint.sh version 2>&1 | tee -a /VERSION.txt
  344. ####################################################
  345. # Expose ArchiveBox's main interfaces to the outside world
  346. WORKDIR "$DATA_DIR"
  347. VOLUME "$DATA_DIR"
  348. EXPOSE 8000
  349. HEALTHCHECK --interval=30s --timeout=20s --retries=15 \
  350. CMD curl --silent 'http://localhost:8000/health/' | grep -q 'OK'
  351. ENTRYPOINT ["dumb-init", "--", "/app/bin/docker_entrypoint.sh"]
  352. CMD ["archivebox", "server", "--quick-init", "0.0.0.0:8000"]