networks:
  1panel-network:
    external: true

services:
  archivebox:
    image: archivebox/archivebox:0.7.3
    container_name: ${CONTAINER_NAME}
    labels:
      createdBy: "Apps"
    restart: always
    networks:
      - 1panel-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:8000
    volumes:
      - ${ARCHIVEBOX_ROOT_PATH}/data:/data
    environment:
      - TZ=Asia/Shanghai
      - ADMIN_USERNAME=${ADMIN_USERNAME}
      - ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - ALLOWED_HOSTS=*
      - CSRF_TRUSTED_ORIGINS=http://localhost:8000
      - PUBLIC_INDEX=${}
      - PUBLIC_SNAPSHOTS=${}
      - PUBLIC_ADD_VIEW=${}
      - SEARCH_BACKEND_ENGINE=sonic
      - SEARCH_BACKEND_HOST_NAME=archivebox-sonic
      - SEARCH_BACKEND_PASSWORD=${ADMIN_PASSWORD:-}

  archivebox-sonic:
    image: archivebox/sonic:latest
    pull_policy: always
    container_name: sonic-${CONTAINER_NAME}
    restart: always
    networks:
      - 1panel-network
    expose:
      - 1491
    volumes:
      - ${ARCHIVEBOX_ROOT_PATH}/sonic:/var/lib/sonic/store
    environment:
      - TZ=Asia/Shanghai
      - SEARCH_BACKEND_PASSWORD=${ADMIN_PASSWORD:-}
