docker-compose.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. # Usage:
  2. # docker compose up
  3. # echo 'https://example.com' | docker compose run -T archivebox add
  4. # docker compose run archivebox add --depth=1 'https://news.ycombinator.com'
  5. # docker compose run archivebox config --set SAVE_ARCHIVE_DOT_ORG=False
  6. # docker compose run archivebox help
  7. # Documentation:
  8. # https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#docker-compose
  9. services:
  10. archivebox:
  11. image: archivebox/archivebox:latest
  12. ports:
  13. - 8000:8000
  14. volumes:
  15. - ./data:/data
  16. environment:
  17. # - ADMIN_USERNAME=admin # create an admin user on first run with the given user/pass combo
  18. # - ADMIN_PASSWORD=SomeSecretPassword
  19. - ALLOWED_HOSTS=* # restrict this to only accept incoming traffic via specific domain name
  20. - PUBLIC_INDEX=True # set to False to prevent anonymous users from viewing snapshot list
  21. - PUBLIC_SNAPSHOTS=True # set to False to prevent anonymous users from viewing snapshot content
  22. - PUBLIC_ADD_VIEW=False # set to True to allow anonymous users to submit new URLs to archive
  23. - SEARCH_BACKEND_ENGINE=sonic # tells ArchiveBox to use sonic container below for fast full-text search
  24. - SEARCH_BACKEND_HOST_NAME=sonic
  25. - SEARCH_BACKEND_PASSWORD=SomeSecretPassword
  26. # - PUID=911 # set to your host user's UID & GID if you encounter permissions issues
  27. # - PGID=911 # UID/GIDs <500 may clash with existing users and are not recommended
  28. # - MEDIA_MAX_SIZE=750m # increase this filesize limit to allow archiving larger audio/video files
  29. # - TIMEOUT=60 # increase this number to 120+ seconds if you see many slow downloads timing out
  30. # - CHECK_SSL_VALIDITY=True # set to False to disable strict SSL checking (allows saving URLs w/ broken certs)
  31. # - SAVE_ARCHIVE_DOT_ORG=True # set to False to disable submitting all URLs to Archive.org when archiving
  32. # ...
  33. # add further configuration options from archivebox/config.py as needed (to apply them only to this container)
  34. # or set using `docker compose run archivebox config --set SOME_KEY=someval` (to persist config across all containers)
  35. # For ad-blocking during archiving, uncomment this section and pihole service section below
  36. # networks:
  37. # - dns
  38. # dns:
  39. # - 172.20.0.53
  40. ######## Optional Addons: tweak examples below as needed for your specific use case ########
  41. ### This optional container runs any scheduled tasks in the background, add new tasks like so:
  42. # $ docker compose run archivebox schedule --add --every=day --depth=1 'https://example.com/some/rss/feed.xml'
  43. # then restart the scheduler container to apply any changes to the scheduled task list:
  44. # $ docker compose restart archivebox_scheduler
  45. archivebox_scheduler:
  46. image: archivebox/archivebox:latest
  47. command: schedule --foreground --update --every=day
  48. environment:
  49. - TIMEOUT=120 # use a higher timeout than the main container to give slow tasks more time when retrying
  50. # - PUID=502 # set to your host user's UID & GID if you encounter permissions issues
  51. # - PGID=20
  52. volumes:
  53. - ./data:/data
  54. # cpus: 2 # uncomment / edit these values to limit scheduler container resource consumption
  55. # mem_limit: 2048m
  56. # restart: always
  57. ### This runs the optional Sonic full-text search backend (much faster than default rg backend).
  58. # If Sonic is ever started after not running for a while, update its full-text index by running:
  59. # $ docker-compose run archivebox update --index-only
  60. sonic:
  61. image: valeriansaliou/sonic:latest
  62. build:
  63. # custom build just auto-downloads archivebox's default sonic.cfg as a convenience
  64. # not needed after first run / if you have already have ./etc/sonic.cfg present
  65. dockerfile_inline: |
  66. FROM quay.io/curl/curl:latest AS config_downloader
  67. RUN curl -fsSL 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/stable/etc/sonic.cfg' > /tmp/sonic.cfg
  68. FROM valeriansaliou/sonic:latest
  69. COPY --from=config_downloader /tmp/sonic.cfg /etc/sonic.cfg
  70. expose:
  71. - 1491
  72. environment:
  73. - SEARCH_BACKEND_PASSWORD=SomeSecretPassword
  74. volumes:
  75. - ./sonic.cfg:/etc/sonic.cfg
  76. - ./data/sonic:/var/lib/sonic/store
  77. ### This container runs xvfb+noVNC so you can watch the ArchiveBox browser as it archives things,
  78. # or remote control it to set up a chrome profile w/ login credentials for sites you want to archive.
  79. # https://github.com/ArchiveBox/ArchiveBox/wiki/Chromium-Install#setting-up-a-chromium-user-profile
  80. novnc:
  81. image: theasp/novnc:latest
  82. environment:
  83. - DISPLAY_WIDTH=1920
  84. - DISPLAY_HEIGHT=1080
  85. - RUN_XTERM=no
  86. ports:
  87. # to view/control ArchiveBox's browser, visit: http://127.0.0.1:8080/vnc.html
  88. # restricted to access from localhost by default because it has no authentication
  89. - 127.0.0.1:8080:8080
  90. ### Example: Put Nginx in front of the ArchiveBox server for SSL termination and static file serving.
  91. # You can also any other ingress provider for SSL like Apache, Caddy, Traefik, Cloudflare Tunnels, etc.
  92. # nginx:
  93. # image: nginx:alpine
  94. # ports:
  95. # - 443:443
  96. # - 80:80
  97. # volumes:
  98. # - ./etc/nginx.conf:/etc/nginx/nginx.conf
  99. # - ./data:/var/www
  100. ### Example: To run pihole in order to block ad/tracker requests during archiving,
  101. # uncomment this block and set up pihole using its admin interface
  102. # pihole:
  103. # image: pihole/pihole:latest
  104. # ports:
  105. # # access the admin HTTP interface on http://localhost:8090
  106. # - 127.0.0.1:8090:80
  107. # environment:
  108. # - WEBPASSWORD=SET_THIS_TO_SOME_SECRET_PASSWORD_FOR_ADMIN_DASHBOARD
  109. # - DNSMASQ_LISTENING=all
  110. # dns:
  111. # - 127.0.0.1
  112. # - 1.1.1.1
  113. # networks:
  114. # dns:
  115. # ipv4_address: 172.20.0.53
  116. # volumes:
  117. # - ./etc/pihole:/etc/pihole
  118. # - ./etc/dnsmasq:/etc/dnsmasq.d
  119. ### Example: Enable ability to run regularly scheduled archiving tasks by uncommenting this container
  120. # $ docker compose run archivebox schedule --every=day --depth=1 'https://example.com/some/rss/feed.xml'
  121. # then restart the scheduler container to apply the changes to the schedule
  122. # $ docker compose restart archivebox_scheduler
  123. # archivebox_scheduler:
  124. # image: archivebox/archivebox:latest
  125. # command: schedule --foreground
  126. # environment:
  127. # - MEDIA_MAX_SIZE=750m # increase this number to allow archiving larger audio/video files
  128. # # - TIMEOUT=60 # increase if you see timeouts often during archiving / on slow networks
  129. # # - ONLY_NEW=True # set to False to retry previously failed URLs when re-adding instead of skipping them
  130. # # - CHECK_SSL_VALIDITY=True # set to False to allow saving URLs w/ broken SSL certs
  131. # # - SAVE_ARCHIVE_DOT_ORG=True # set to False to disable submitting URLs to Archive.org when archiving
  132. # # - PUID=502 # set to your host user's UID & GID if you encounter permissions issues
  133. # # - PGID=20
  134. # volumes:
  135. # - ./data:/data
  136. # - ./etc/crontabs:/var/spool/cron/crontabs
  137. # # cpus: 2 # uncomment / edit these values to limit container resource consumption
  138. # # mem_limit: 2048m
  139. # # shm_size: 1024m
  140. ### Example: Put Nginx in front of the ArchiveBox server for SSL termination
  141. # nginx:
  142. # image: nginx:alpine
  143. # ports:
  144. # - 443:443
  145. # - 80:80
  146. # volumes:
  147. # - ./etc/nginx.conf:/etc/nginx/nginx.conf
  148. # - ./data:/var/www
  149. ### Example: run all your ArchiveBox traffic through a WireGuard VPN tunnel to avoid IP blocks.
  150. # You can also use any other VPN that works at the docker IP level, e.g. Tailscale, OpenVPN, etc.
  151. # wireguard:
  152. # image: linuxserver/wireguard:latest
  153. # network_mode: 'service:archivebox'
  154. # cap_add:
  155. # - NET_ADMIN
  156. # - SYS_MODULE
  157. # sysctls:
  158. # - net.ipv4.conf.all.rp_filter=2
  159. # - net.ipv4.conf.all.src_valid_mark=1
  160. # volumes:
  161. # - /lib/modules:/lib/modules
  162. # - ./wireguard.conf:/config/wg0.conf:ro
  163. ### Example: Run browsertrix in parallel with ArchiveBox
  164. # browsertrix:
  165. # image: webrecorder/browsertrix-crawler:latest
  166. # volumes:
  167. # - ./browsertrix:/crawls:z
  168. ### Example: Run PYWB in parallel and auto-import WARCs from ArchiveBox
  169. # pywb:
  170. # image: webrecorder/pywb:latest
  171. # entrypoint: /bin/sh -c '(wb-manager init default || test $$? -eq 2) && wb-manager add default /archivebox/archive/*/warc/*.warc.gz; wayback;'
  172. # environment:
  173. # - INIT_COLLECTION=archivebox
  174. # ports:
  175. # - 8080:8080
  176. # volumes:
  177. # - ./data:/archivebox
  178. # - ./data/wayback:/webarchive
  179. networks:
  180. # network just used for pihole container to offer :53 dns resolving on fixed ip for archivebox container
  181. dns:
  182. ipam:
  183. driver: default
  184. config:
  185. - subnet: 172.20.0.0/24
  186. # To use remote storage for your ./data/archive (e.g. Amazon S3, Backblaze B2, Google Drive, OneDrive, SFTP, etc.)
  187. # Follow the steps here to set up the Docker RClone Plugin https://rclone.org/docker/
  188. # $ docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone
  189. # $ nano /var/lib/docker-plugins/rclone/config/rclone.conf
  190. # [examplegdrive]
  191. # type = drive
  192. # scope = drive
  193. # drive_id = 1234567...
  194. # root_folder_id = 0Abcd...
  195. # token = {"access_token":...}
  196. # volumes:
  197. # archive:
  198. # driver: rclone
  199. # driver_opts:
  200. # remote: 'examplegdrive:archivebox'
  201. # allow_other: 'true'
  202. # vfs_cache_mode: full
  203. # poll_interval: 0