docker-compose.yml 9.8 KB

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