name: searxng

services:
  searxng:
    container_name: searxng
    image: docker.io/searxng/searxng:${SEARXNG_VERSION:-latest}
    restart: on-failure:7
    depends_on:
      - caddy
    profiles:
      - searxng
    env_file: ./config/searxng.env
    environment:
      - TZ=${TZ:-Europe/Paris}
    networks:
      - caddy-tools
      - searxng-internal
    volumes:
      - searxng-config:/etc/searxng/
      - searxng-data:/var/cache/searxng/
    dns:
      - 1.1.1.1
      - 8.8.8.8

  valkey:
    container_name: searxng-valkey
    profiles:
      - searxng
    image: docker.io/valkey/valkey:9-alpine
    command: valkey-server --save 30 1 --loglevel warning
    restart: on-failure:7
    environment:
      - TZ=${TZ:-Europe/Paris}
    networks:
      - searxng-internal
    volumes:
      - valkey-data:/data/

networks:
  caddy-tools:
    driver: bridge
    name: caddy-tools
  searxng-internal:
    driver: bridge
    name: searxng-internal

volumes:
  searxng-data: {}
  searxng-config: {}
  valkey-data: {}

