# ArchiveBox - Web archiving
# Port: 8000
# Self-hosted internet archiving solution
version: '3.8'

services:
  archivebox:
    image: archivebox/archivebox:latest
    container_name: archivebox
    ports:
      - "7254:8000"
    volumes:
      - ./data:/data
    environment:
      - PUID=1000
      - PGID=1000
      - ADMIN_USERNAME=vish
      - ADMIN_PASSWORD="REDACTED_PASSWORD"
      - ALLOWED_HOSTS=*
      - CSRF_TRUSTED_ORIGINS=http://localhost:7254
      - PUBLIC_INDEX=True
      - PUBLIC_SNAPSHOTS=True
      - PUBLIC_ADD_VIEW=False
      - SEARCH_BACKEND_ENGINE=sonic
      - SEARCH_BACKEND_HOST_NAME=sonic
      - SEARCH_BACKEND_PASSWORD="REDACTED_PASSWORD"
    restart: unless-stopped

  archivebox_scheduler:
    image: archivebox/archivebox:latest
    container_name: archivebox_scheduler
    command: schedule --foreground --update --every=day
    volumes:
      - ./data:/data
    environment:
      - PUID=1000
      - PGID=1000
      - TIMEOUT=120
      - SEARCH_BACKEND_ENGINE=sonic
      - SEARCH_BACKEND_HOST_NAME=sonic
      - SEARCH_BACKEND_PASSWORD="REDACTED_PASSWORD"
    restart: unless-stopped

  sonic:
    image: archivebox/sonic:latest
    container_name: archivebox_sonic
    expose:
      - "1491"
    environment:
      - SEARCH_BACKEND_PASSWORD="REDACTED_PASSWORD"
    volumes:
      - ./data/sonic:/var/lib/sonic/store
    restart: unless-stopped

networks:
  default:
    name: archivebox_net
