玩客云docker部署searxng搜索引擎

searxng-docker,使用 Docker 创建SearXNG 实例。

部署

git clone https://github.com/searxng/searxng-docker.git
cd searxng-docker
mv docker-compose.yaml docker-compose.yaml.bak
nano docker-compose.yaml

docker-compose.yaml内容如下:

version: '3.7'
 services:
  redis:
    container_name: redis
    image: "redis:alpine"
    command: redis-server --save "" --appendonly "no"
    networks:
      - searxng
    tmpfs:
      - /var/lib/redis
    cap_drop:
      - ALL
    cap_add:
      - SETGID
      - SETUID
      - DAC_OVERRIDE
 
  searxng:
    container_name: searxng
    image: searxng/searxng:latest
    networks:
      - searxng
    ports:
     - "8180:8080"   # 这个冒号左边的端口可以更改,右边的不要改
    volumes:
      - ./searxng:/etc/searxng:rw
    environment:
      - SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-https://你的域名}/
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
      - DAC_OVERRIDE
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "1"
networks:
  searxng:
    ipam:
      driver: default

sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml
docker compose up -d

从ip:8180访问