# vim: ft=yaml.ansible
---
- name: Create SearXNG volume directory
ansible.builtin.file:
path: "{{ services.searxng.volume }}"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
- name: Copy SearXNG settings.yml file
ansible.builtin.template:
src: settings.yml.j2
dest: "{{ services.searxng.volume }}/settings.yml"
mode: u=rw,g=r,o=r
- name: Deploy SearXNG with Docker Compose
community.docker.docker_compose:
project_name: searxng
state: "{{ 'absent' if stop is defined and stop else 'present' }}"
restarted: "{{ stop is undefined or not stop }}"
remove_orphans: true
pull: true
definition:
version: '3.8'
services:
app:
image: searxng/searxng:{{ services.searxng.version }}
restart: always
environment:
SEARXNG_BASE_URL: https://{{ services.searxng.domain }}
networks:
default:
aliases:
- searxng
tor:
volumes:
- "{{ services.searxng.volume }}:/etc/searxng:rw"
cap_add:
- chown
- setuid
- setgid
- dac_override
cap_drop:
- all
logging:
driver: json-file
options:
max-size: 1m
max-file: '1'
redis:
image: redis:{{ services.searxng.redis_version }}
command: redis-server --save "" --appendonly "no"
tmpfs:
- /var/lib/redis
external: true