Use archivebox/sonic multi-arch container with bundled config file

This commit is contained in:
Nick Sweeting
2024-11-13 11:08:00 -05:00
committed by GitHub
parent 5cb1fd7803
commit 6448968952

View File

@@ -2,10 +2,9 @@
# curl -fsSL 'https://docker-compose.archivebox.io' > docker-compose.yml # curl -fsSL 'https://docker-compose.archivebox.io' > docker-compose.yml
# docker compose up # docker compose up
# docker compose run archivebox version # docker compose run archivebox version
# echo 'https://example.com' | docker compose run -T archivebox add # docker compose run -T archivebox add < urls_to_archive.txt
# docker compose run archivebox add --depth=1 'https://news.ycombinator.com' # docker compose run archivebox add --depth=1 'https://news.ycombinator.com'
# docker compose run archivebox config --set SAVE_ARCHIVE_DOT_ORG=False # docker compose run archivebox config --set SAVE_ARCHIVE_DOT_ORG=False
# docker compose run archivebox status
# docker compose run archivebox help # docker compose run archivebox help
# Documentation: # Documentation:
# https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#docker-compose # https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#docker-compose
@@ -19,7 +18,7 @@ services:
- ./data:/data - ./data:/data
# ./data/personas/Default/chrome_profile/Default:/data/personas/Default/chrome_profile/Default # ./data/personas/Default/chrome_profile/Default:/data/personas/Default/chrome_profile/Default
environment: environment:
# - ADMIN_USERNAME=admin # create an admin user on first run with the given user/pass combo # - ADMIN_USERNAME=admin # creates an admin user on first run with the given user/pass combo
# - ADMIN_PASSWORD=SomeSecretPassword # - ADMIN_PASSWORD=SomeSecretPassword
- CSRF_TRUSTED_ORIGINS=https://archivebox.example.com # REQUIRED for auth, REST API, etc. to work - CSRF_TRUSTED_ORIGINS=https://archivebox.example.com # REQUIRED for auth, REST API, etc. to work
- ALLOWED_HOSTS=* # set this to the hostname(s) from your CSRF_TRUSTED_ORIGINS - ALLOWED_HOSTS=* # set this to the hostname(s) from your CSRF_TRUSTED_ORIGINS
@@ -31,15 +30,16 @@ services:
- SEARCH_BACKEND_PASSWORD=SomeSecretPassword - SEARCH_BACKEND_PASSWORD=SomeSecretPassword
# - PUID=911 # set to your host user's UID & GID if you encounter permissions issues # - PUID=911 # set to your host user's UID & GID if you encounter permissions issues
# - PGID=911 # UID/GIDs <500 may clash with existing users and are not recommended # - PGID=911 # UID/GIDs <500 may clash with existing users and are not recommended
# For options below, it's better to set using `docker compose run archivebox config --set SOME_KEY=someval` instead of setting here:
# - MEDIA_MAX_SIZE=750m # increase this filesize limit to allow archiving larger audio/video files # - MEDIA_MAX_SIZE=750m # increase this filesize limit to allow archiving larger audio/video files
# - TIMEOUT=60 # increase this number to 120+ seconds if you see many slow downloads timing out # - TIMEOUT=60 # increase this number to 120+ seconds if you see many slow downloads timing out
# - CHECK_SSL_VALIDITY=True # set to False to disable strict SSL checking (allows saving URLs w/ broken certs) # - CHECK_SSL_VALIDITY=True # set to False to disable strict SSL checking (allows saving URLs w/ broken certs)
# - SAVE_ARCHIVE_DOT_ORG=True # set to False to disable submitting all URLs to Archive.org when archiving # - SAVE_ARCHIVE_DOT_ORG=True # set to False to disable submitting all URLs to Archive.org when archiving
# - USER_AGENT="..." # set a custom USER_AGENT to avoid being blocked as a bot # - USER_AGENT="..." # set a custom USER_AGENT to avoid being blocked as a bot
# ... # ...
# add further configuration options from archivebox/config.py as needed (to apply them only to this container) # For more info, see: https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#configuration
# or set using `docker compose run archivebox config --set SOME_KEY=someval` (to persist config across all containers)
# For ad-blocking during archiving, uncomment this section and pihole service section below # For ad-blocking during archiving, uncomment this section and the pihole service below
# networks: # networks:
# - dns # - dns
# dns: # dns:
@@ -48,7 +48,7 @@ services:
######## Optional Addons: tweak examples below as needed for your specific use case ######## ######## Optional Addons: tweak examples below as needed for your specific use case ########
### This optional container runs any scheduled tasks in the background, add new tasks like so: ### This optional container runs scheduled jobs in the background (and retries failed ones). To add a new job:
# $ docker compose run archivebox schedule --add --every=day --depth=1 'https://example.com/some/rss/feed.xml' # $ docker compose run archivebox schedule --add --every=day --depth=1 'https://example.com/some/rss/feed.xml'
# then restart the scheduler container to apply any changes to the scheduled task list: # then restart the scheduler container to apply any changes to the scheduled task list:
# $ docker compose restart archivebox_scheduler # $ docker compose restart archivebox_scheduler
@@ -59,9 +59,15 @@ services:
image: archivebox/archivebox:latest image: archivebox/archivebox:latest
command: schedule --foreground --update --every=day command: schedule --foreground --update --every=day
environment: environment:
# - PUID=911 # set to your host user's UID & GID if you encounter permissions issues
# - PGID=911
- TIMEOUT=120 # use a higher timeout than the main container to give slow tasks more time when retrying - TIMEOUT=120 # use a higher timeout than the main container to give slow tasks more time when retrying
# - PUID=502 # set to your host user's UID & GID if you encounter permissions issues - SEARCH_BACKEND_ENGINE=sonic # tells ArchiveBox to use sonic container below for fast full-text search
# - PGID=20 - SEARCH_BACKEND_HOST_NAME=sonic
- SEARCH_BACKEND_PASSWORD=SomeSecretPassword
# For other config it's better to set using `docker compose run archivebox config --set SOME_KEY=someval` instead of setting here
# ...
# For more info, see: https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#configuration
volumes: volumes:
- ./data:/data - ./data:/data
# cpus: 2 # uncomment / edit these values to limit scheduler container resource consumption # cpus: 2 # uncomment / edit these values to limit scheduler container resource consumption
@@ -75,25 +81,17 @@ services:
# https://github.com/ArchiveBox/ArchiveBox/wiki/Setting-up-Search # https://github.com/ArchiveBox/ArchiveBox/wiki/Setting-up-Search
sonic: sonic:
image: valeriansaliou/sonic:latest image: archivebox/sonic:latest
build:
# custom build just auto-downloads archivebox's default sonic.cfg as a convenience
# not needed after first run / if you have already have ./etc/sonic.cfg present
dockerfile_inline: |
FROM quay.io/curl/curl:latest AS config_downloader
RUN curl -fsSL 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/stable/etc/sonic.cfg' > /tmp/sonic.cfg
FROM valeriansaliou/sonic:latest
COPY --from=config_downloader /tmp/sonic.cfg /etc/sonic.cfg
expose: expose:
- 1491 - 1491
environment: environment:
- SEARCH_BACKEND_PASSWORD=SomeSecretPassword - SEARCH_BACKEND_PASSWORD=SomeSecretPassword
volumes: volumes:
#- ./sonic.cfg:/etc/sonic.cfg:ro # use this if you prefer to download the config on the host and mount it manually #- ./sonic.cfg:/etc/sonic.cfg:ro # mount to customize: https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/stable/etc/sonic.cfg
- ./data/sonic:/var/lib/sonic/store - ./data/sonic:/var/lib/sonic/store
### This container runs xvfb+noVNC so you can watch the ArchiveBox browser as it archives things, ### This optional container runs xvfb+noVNC so you can watch the ArchiveBox browser as it archives things,
# or remote control it to set up a chrome profile w/ login credentials for sites you want to archive. # or remote control it to set up a chrome profile w/ login credentials for sites you want to archive.
# https://github.com/ArchiveBox/ArchiveBox/wiki/Chromium-Install#setting-up-a-chromium-user-profile # https://github.com/ArchiveBox/ArchiveBox/wiki/Chromium-Install#setting-up-a-chromium-user-profile
# https://github.com/ArchiveBox/ArchiveBox/wiki/Chromium-Install#docker-vnc-setup # https://github.com/ArchiveBox/ArchiveBox/wiki/Chromium-Install#docker-vnc-setup
@@ -124,7 +122,7 @@ services:
### Example: To run pihole in order to block ad/tracker requests during archiving, ### Example: To run pihole in order to block ad/tracker requests during archiving,
# uncomment this block and set up pihole using its admin interface # uncomment this optional block and set up pihole using its admin interface
# pihole: # pihole:
# image: pihole/pihole:latest # image: pihole/pihole:latest
@@ -146,7 +144,7 @@ services:
### Example: run all your ArchiveBox traffic through a WireGuard VPN tunnel to avoid IP blocks. ### Example: run all your ArchiveBox traffic through a WireGuard VPN tunnel to avoid IP blocks.
# You can also use any other VPN that works at the docker IP level, e.g. Tailscale, OpenVPN, etc. # You can also use any other VPN that works at the docker/IP level, e.g. Tailscale, OpenVPN, etc.
# wireguard: # wireguard:
# image: linuxserver/wireguard:latest # image: linuxserver/wireguard:latest