2019-02-28 18:59:52 +00:00
|
|
|
# Usage:
|
2023-06-14 00:13:55 +00:00
|
|
|
# docker compose up
|
2024-03-28 03:15:27 +00:00
|
|
|
# echo 'https://example.com' | docker compose run -T archivebox add
|
|
|
|
# docker compose run archivebox add --depth=1 'https://news.ycombinator.com'
|
|
|
|
# docker compose run archivebox config --set SAVE_ARCHIVE_DOT_ORG=False
|
2023-06-14 00:13:55 +00:00
|
|
|
# docker compose run archivebox help
|
2019-02-28 18:59:52 +00:00
|
|
|
# Documentation:
|
2020-11-23 07:04:39 +00:00
|
|
|
# https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#docker-compose
|
2019-02-28 18:59:52 +00:00
|
|
|
|
2019-01-16 14:20:15 +00:00
|
|
|
services:
|
|
|
|
archivebox:
|
2024-03-26 22:23:43 +00:00
|
|
|
image: archivebox/archivebox:latest
|
2020-07-21 16:16:29 +00:00
|
|
|
ports:
|
|
|
|
- 8000:8000
|
2023-06-14 00:13:55 +00:00
|
|
|
volumes:
|
|
|
|
- ./data:/data
|
2019-01-16 14:20:15 +00:00
|
|
|
environment:
|
2023-10-18 18:53:13 +00:00
|
|
|
# - ADMIN_USERNAME=admin # create an admin user on first run with the given user/pass combo
|
|
|
|
# - ADMIN_PASSWORD=SomeSecretPassword
|
2024-03-26 22:23:43 +00:00
|
|
|
- ALLOWED_HOSTS=* # restrict this to only accept incoming traffic via specific domain name
|
|
|
|
- PUBLIC_INDEX=True # set to False to prevent anonymous users from viewing snapshot list
|
|
|
|
- PUBLIC_SNAPSHOTS=True # set to False to prevent anonymous users from viewing snapshot content
|
|
|
|
- PUBLIC_ADD_VIEW=False # set to True to allow anonymous users to submit new URLs to archive
|
2024-03-28 03:15:27 +00:00
|
|
|
- SEARCH_BACKEND_ENGINE=sonic # tells ArchiveBox to use sonic container below for fast full-text search
|
2024-03-26 22:22:40 +00:00
|
|
|
- SEARCH_BACKEND_HOST_NAME=sonic
|
|
|
|
- SEARCH_BACKEND_PASSWORD=SomeSecretPassword
|
2024-03-26 22:23:43 +00:00
|
|
|
# - PUID=911 # set to your host user's UID & GID if you encounter permissions issues
|
2024-03-28 03:15:27 +00:00
|
|
|
# - PGID=911 # UID/GIDs <500 may clash with existing users and are not recommended
|
2023-11-08 08:14:05 +00:00
|
|
|
# - 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
|
|
|
|
# - 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
|
2023-06-14 00:13:55 +00:00
|
|
|
# ...
|
|
|
|
# add further configuration options from archivebox/config.py as needed (to apply them only to this container)
|
|
|
|
# or set using `docker compose run archivebox config --set SOME_KEY=someval` (to persist config across all containers)
|
2024-03-26 22:22:40 +00:00
|
|
|
# For ad-blocking during archiving, uncomment this section and pihole service section below
|
2023-11-08 08:14:05 +00:00
|
|
|
# networks:
|
|
|
|
# - dns
|
|
|
|
# dns:
|
|
|
|
# - 172.20.0.53
|
2021-04-06 03:17:07 +00:00
|
|
|
|
2022-03-16 21:14:35 +00:00
|
|
|
|
2023-06-14 00:13:55 +00:00
|
|
|
######## Optional Addons: tweak examples below as needed for your specific use case ########
|
2022-03-16 21:14:35 +00:00
|
|
|
|
2024-03-28 03:15:27 +00:00
|
|
|
### This optional container runs any scheduled tasks in the background, add new tasks like so:
|
|
|
|
# $ 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:
|
2024-03-26 22:23:43 +00:00
|
|
|
# $ docker compose restart archivebox_scheduler
|
|
|
|
|
|
|
|
archivebox_scheduler:
|
|
|
|
image: archivebox/archivebox:latest
|
2024-03-28 03:15:27 +00:00
|
|
|
command: schedule --foreground --update --every=day
|
2024-03-26 22:23:43 +00:00
|
|
|
environment:
|
2024-03-28 03:15:27 +00:00
|
|
|
- TIMEOUT=120 # use a higher timeout than the main container to give slow tasks more time when retrying
|
2024-03-26 22:23:43 +00:00
|
|
|
# - PUID=502 # set to your host user's UID & GID if you encounter permissions issues
|
|
|
|
# - PGID=20
|
|
|
|
volumes:
|
|
|
|
- ./data:/data
|
2024-03-28 03:15:27 +00:00
|
|
|
# cpus: 2 # uncomment / edit these values to limit scheduler container resource consumption
|
2024-03-26 22:23:43 +00:00
|
|
|
# mem_limit: 2048m
|
2024-03-28 03:15:27 +00:00
|
|
|
# restart: always
|
2024-03-26 22:23:43 +00:00
|
|
|
|
|
|
|
|
2024-03-28 03:15:27 +00:00
|
|
|
### This runs the optional Sonic full-text search backend (much faster than default rg backend).
|
|
|
|
# If Sonic is ever started after not running for a while, update its full-text index by running:
|
2023-06-14 00:13:55 +00:00
|
|
|
# $ docker-compose run archivebox update --index-only
|
2022-03-23 00:55:17 +00:00
|
|
|
|
2024-03-26 22:22:40 +00:00
|
|
|
sonic:
|
2024-03-26 22:23:43 +00:00
|
|
|
image: valeriansaliou/sonic:latest
|
2024-03-26 22:22:40 +00:00
|
|
|
build:
|
2024-03-26 22:23:43 +00:00
|
|
|
# custom build just auto-downloads archivebox's default sonic.cfg as a convenience
|
2024-03-28 03:15:27 +00:00
|
|
|
# not needed after first run / if you have already have ./etc/sonic.cfg present
|
2024-03-26 22:22:40 +00:00
|
|
|
dockerfile_inline: |
|
2024-03-28 03:15:27 +00:00
|
|
|
FROM quay.io/curl/curl:latest AS config_downloader
|
2024-03-26 22:22:40 +00:00
|
|
|
RUN curl -fsSL 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/main/etc/sonic.cfg' > /tmp/sonic.cfg
|
|
|
|
FROM valeriansaliou/sonic:latest
|
2024-03-28 03:15:27 +00:00
|
|
|
COPY --from=config_downloader /tmp/sonic.cfg /etc/sonic.cfg
|
2024-03-26 22:22:40 +00:00
|
|
|
expose:
|
|
|
|
- 1491
|
|
|
|
environment:
|
|
|
|
- SEARCH_BACKEND_PASSWORD=SomeSecretPassword
|
|
|
|
volumes:
|
2024-03-28 03:15:27 +00:00
|
|
|
- ./sonic.cfg:/etc/sonic.cfg
|
2024-03-26 22:22:40 +00:00
|
|
|
- ./data/sonic:/var/lib/sonic/store
|
|
|
|
|
2024-03-26 22:23:43 +00:00
|
|
|
|
2024-03-28 03:15:27 +00:00
|
|
|
### This 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.
|
2024-03-26 22:23:43 +00:00
|
|
|
# https://github.com/ArchiveBox/ArchiveBox/wiki/Chromium-Install#setting-up-a-chromium-user-profile
|
|
|
|
|
|
|
|
novnc:
|
|
|
|
image: theasp/novnc:latest
|
|
|
|
environment:
|
|
|
|
- DISPLAY_WIDTH=1920
|
|
|
|
- DISPLAY_HEIGHT=1080
|
|
|
|
- RUN_XTERM=no
|
|
|
|
ports:
|
2024-03-28 03:15:27 +00:00
|
|
|
# to view/control ArchiveBox's browser, visit: http://127.0.0.1:8080/vnc.html
|
|
|
|
# restricted to access from localhost by default because it has no authentication
|
|
|
|
- 127.0.0.1:8080:8080
|
2024-03-26 22:23:43 +00:00
|
|
|
|
|
|
|
|
2024-03-28 03:15:27 +00:00
|
|
|
### Example: Put Nginx in front of the ArchiveBox server for SSL termination and static file serving.
|
|
|
|
# You can also any other ingress provider for SSL like Apache, Caddy, Traefik, Cloudflare Tunnels, etc.
|
2024-03-26 22:23:43 +00:00
|
|
|
|
|
|
|
# nginx:
|
|
|
|
# image: nginx:alpine
|
|
|
|
# ports:
|
|
|
|
# - 443:443
|
|
|
|
# - 80:80
|
|
|
|
# volumes:
|
|
|
|
# - ./etc/nginx.conf:/etc/nginx/nginx.conf
|
|
|
|
# - ./data:/var/www
|
|
|
|
|
|
|
|
|
2022-03-23 00:55:17 +00:00
|
|
|
### Example: To run pihole in order to block ad/tracker requests during archiving,
|
|
|
|
# uncomment this block and set up pihole using its admin interface
|
|
|
|
|
2022-03-16 21:12:18 +00:00
|
|
|
# pihole:
|
2022-03-23 00:55:17 +00:00
|
|
|
# image: pihole/pihole:latest
|
|
|
|
# ports:
|
2024-03-28 03:15:27 +00:00
|
|
|
# # access the admin HTTP interface on http://localhost:8090
|
|
|
|
# - 127.0.0.1:8090:80
|
2022-03-23 00:55:17 +00:00
|
|
|
# environment:
|
2023-06-14 00:13:55 +00:00
|
|
|
# - WEBPASSWORD=SET_THIS_TO_SOME_SECRET_PASSWORD_FOR_ADMIN_DASHBOARD
|
2023-11-08 08:14:05 +00:00
|
|
|
# - DNSMASQ_LISTENING=all
|
|
|
|
# dns:
|
|
|
|
# - 127.0.0.1
|
|
|
|
# - 1.1.1.1
|
|
|
|
# networks:
|
|
|
|
# dns:
|
|
|
|
# ipv4_address: 172.20.0.53
|
2022-03-23 00:55:17 +00:00
|
|
|
# volumes:
|
2023-06-14 00:13:55 +00:00
|
|
|
# - ./etc/pihole:/etc/pihole
|
|
|
|
# - ./etc/dnsmasq:/etc/dnsmasq.d
|
2022-03-23 00:55:17 +00:00
|
|
|
|
|
|
|
|
2024-03-28 03:15:27 +00:00
|
|
|
### 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.
|
2022-03-23 00:55:17 +00:00
|
|
|
|
2020-07-29 22:37:34 +00:00
|
|
|
# wireguard:
|
2023-06-13 12:49:22 +00:00
|
|
|
# image: linuxserver/wireguard:latest
|
2020-07-29 22:37:34 +00:00
|
|
|
# network_mode: 'service:archivebox'
|
|
|
|
# cap_add:
|
|
|
|
# - NET_ADMIN
|
|
|
|
# - SYS_MODULE
|
|
|
|
# sysctls:
|
|
|
|
# - net.ipv4.conf.all.rp_filter=2
|
|
|
|
# - net.ipv4.conf.all.src_valid_mark=1
|
|
|
|
# volumes:
|
|
|
|
# - /lib/modules:/lib/modules
|
|
|
|
# - ./wireguard.conf:/config/wg0.conf:ro
|
2021-04-06 03:17:07 +00:00
|
|
|
|
2022-03-23 00:55:17 +00:00
|
|
|
|
|
|
|
### Example: Run PYWB in parallel and auto-import WARCs from ArchiveBox
|
|
|
|
|
2020-07-28 10:01:06 +00:00
|
|
|
# pywb:
|
|
|
|
# image: webrecorder/pywb:latest
|
2022-04-06 02:58:40 +00:00
|
|
|
# entrypoint: /bin/sh -c '(wb-manager init default || test $$? -eq 2) && wb-manager add default /archivebox/archive/*/warc/*.warc.gz; wayback;'
|
2020-07-28 10:01:06 +00:00
|
|
|
# environment:
|
|
|
|
# - INIT_COLLECTION=archivebox
|
|
|
|
# ports:
|
|
|
|
# - 8080:8080
|
|
|
|
# volumes:
|
2022-01-27 18:24:59 +00:00
|
|
|
# - ./data:/archivebox
|
|
|
|
# - ./data/wayback:/webarchive
|
2023-11-08 08:14:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
networks:
|
2024-03-28 03:15:27 +00:00
|
|
|
# network just used for pihole container to offer :53 dns resolving on fixed ip for archivebox container
|
2023-11-08 08:14:05 +00:00
|
|
|
dns:
|
|
|
|
ipam:
|
|
|
|
driver: default
|
|
|
|
config:
|
2023-11-14 10:04:49 +00:00
|
|
|
- subnet: 172.20.0.0/24
|