Add searx deployment
This commit is contained in:
parent
27daf9031b
commit
1fae9f9a19
11 changed files with 211 additions and 0 deletions
30
roles/searx/templates/docker-stack.yml.j2
Normal file
30
roles/searx/templates/docker-stack.yml.j2
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
app:
|
||||
image: {{ stack_image }}:{{ searx_version }}
|
||||
networks:
|
||||
- "{{ docker_swarm_public_network_name }}"
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080"]
|
||||
interval: 1m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 1m
|
||||
environment:
|
||||
- BIND_ADDRESS=0.0.0.0:8080
|
||||
{% if server_domain is not undefined and not none %}
|
||||
- "BASE_URL={{ (searx_use_https == True) | ternary('https', 'http') }}://{{ (subdomain_alias is not undefined and not none) | ternary(subdomain_alias, stack_name) }}.{{server_domain}}"
|
||||
{% else %}
|
||||
- "BASE_URL={{ (searx_use_https == True) | ternary('https', 'http') }}://localhost/{{ (subdomain_alias is not undefined and not none) | ternary(subdomain_alias, stack_name) }}"
|
||||
{% endif %}
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- data:/etc/searx:rw
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
networks:
|
||||
"{{ docker_swarm_public_network_name }}":
|
||||
external: true
|
||||
38
roles/searx/templates/upstream.json.j2
Normal file
38
roles/searx/templates/upstream.json.j2
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"@id": "{{ stack_name }}_upstream",
|
||||
{% if server_domain is not undefined and not none %}
|
||||
"match": [
|
||||
{
|
||||
"host": [
|
||||
{% if subdomain_alias is not undefined and not none %}
|
||||
"{{ subdomain_alias }}.{{ server_domain }}"
|
||||
{% else %}
|
||||
"{{ stack_name }}.{{ server_domain }}"
|
||||
{% endif %}
|
||||
]
|
||||
}
|
||||
],
|
||||
{% else %}
|
||||
"match": [
|
||||
{
|
||||
"path": [
|
||||
{% if subdomain_alias is not undefined and not none %}
|
||||
"/{{ subdomain_alias }}*"
|
||||
{% else %}
|
||||
"/{{ stack_name }}*"
|
||||
{% endif %}
|
||||
]
|
||||
}
|
||||
],
|
||||
{% endif %}
|
||||
"handle": [
|
||||
{
|
||||
"handler": "reverse_proxy",
|
||||
"upstreams": [
|
||||
{
|
||||
"dial": "{{ stack_name }}_app:8080"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue