networks:
  1panel-network:
    external: true
services:
  archivebox:
    container_name: archivebox
    depends_on:
    - archivebox-init
    env_file:
    - ./envs/global.env
    - .env
    environment:
    - TZ=Asia/Shanghai
    - ALLOWED_HOSTS=*
    - CSRF_TRUSTED_ORIGINS=http://localhost:8000
    - SEARCH_BACKEND_ENGINE=sonic
    - SEARCH_BACKEND_HOST_NAME=archivebox-sonic
    - SEARCH_BACKEND_PASSWORD=${ADMIN_PASSWORD:-}
    image: archivebox/archivebox:0.8.5rc51
    labels:
      createdBy: Apps
    networks:
    - 1panel-network
    ports:
    - ${PANEL_APP_PORT_HTTP}:8000
    restart: always
    volumes:
    - ${ARCHIVEBOX_ROOT_PATH}/data:/data
  archivebox-init:
    command: archivebox init
    container_name: init-archivebox
    env_file:
    - ./envs/global.env
    - .env
    environment:
    - TZ=Asia/Shanghai
    - ALLOWED_HOSTS=*
    - CSRF_TRUSTED_ORIGINS=http://localhost:8000
    - SEARCH_BACKEND_ENGINE=sonic
    - SEARCH_BACKEND_HOST_NAME=archivebox-sonic
    - SEARCH_BACKEND_PASSWORD=${ADMIN_PASSWORD:-}
    image: archivebox/archivebox:0.8.5rc51
    labels:
      createdBy: Apps
    networks:
    - 1panel-network
    volumes:
    - ${ARCHIVEBOX_ROOT_PATH}/data:/data
  archivebox-sonic:
    container_name: sonic-archivebox
    env_file:
    - ./envs/global.env
    - .env
    environment:
    - TZ=Asia/Shanghai
    - SEARCH_BACKEND_PASSWORD=${ADMIN_PASSWORD:-}
    expose:
    - 1491
    image: archivebox/sonic:latest
    networks:
    - 1panel-network
    restart: always
    volumes:
    - ${ARCHIVEBOX_ROOT_PATH}/sonic:/var/lib/sonic/store
