This repository has been archived on 2024-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
cpx-ansible/roles/docker_services/tasks/services/searxng.yml

89 lines
2.3 KiB
YAML
Raw Normal View History

2023-04-20 21:34:25 +00:00
# vim: ft=yaml.ansible
---
- name: Create SearXNG volume directory
ansible.builtin.file:
2023-06-24 08:22:35 +00:00
path: "{{ services.searxng.volume }}/searxng"
2023-04-20 21:34:25 +00:00
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
2023-06-24 08:22:35 +00:00
- name: Create SearXNG volume directory for Redis
ansible.builtin.file:
path: "{{ services.searxng.volume }}/redis"
owner: '999'
group: '1000'
mode: u=rwx,g=rx,o=rx
state: directory
2023-04-20 21:34:25 +00:00
- name: Copy SearXNG settings.yml file
ansible.builtin.template:
src: settings.yml.j2
2023-06-24 08:22:35 +00:00
dest: "{{ services.searxng.volume }}/searxng/settings.yml"
2023-04-20 21:34:25 +00:00
owner: root
mode: u=rw,g=r,o=r
- name: Copy SearXNG limiter.toml file
ansible.builtin.template:
src: limiter.toml.j2
2023-06-24 08:22:35 +00:00
dest: "{{ services.searxng.volume }}/searxng/limiter.toml"
owner: root
mode: u=rw,g=r,o=r
2023-04-20 21:34:25 +00:00
- 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 }}"
2023-04-26 16:49:36 +00:00
remove_orphans: true
2023-04-20 21:34:25 +00:00
pull: true
definition:
version: '3.8'
services:
2023-04-26 16:48:32 +00:00
app:
2023-04-20 21:34:25 +00:00
image: searxng/searxng:{{ services.searxng.version }}
restart: always
environment:
SEARXNG_BASE_URL: https://{{ services.searxng.domain }}
networks:
default:
services:
aliases:
- searxng
tor:
aliases:
- searxng
volumes:
2023-06-24 08:22:35 +00:00
- "{{ services.searxng.volume }}/searxng:/etc/searxng:rw"
2023-04-20 21:34:25 +00:00
cap_add:
- chown
2023-06-24 08:22:35 +00:00
- dac_override
2023-04-20 21:34:25 +00:00
- setuid
- setgid
cap_drop:
- all
logging:
driver: json-file
options:
max-size: 1m
max-file: '1'
redis:
image: redis:{{ services.searxng.redis_version }}
restart: always
2023-06-24 08:22:35 +00:00
command: redis-server --save 60 1 --appendonly no
volumes:
- "{{ services.searxng.volume }}/redis:/data:rw"
2023-04-20 21:34:25 +00:00
cap_add:
2023-06-24 08:22:35 +00:00
- dac_override
2023-04-20 21:34:25 +00:00
- setuid
- setgid
cap_drop:
- all
networks:
services:
external: true
tor:
external: true