docker-compose.yml 9.9 KB

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