Add wallabag docker deployment role
Added role of wallabag. Can take a subdomain alias to be presented on a different uri than its stack name. All services contain a healthcheck for docker swarm to be informed of their status. Copy whoami template to wallabag role Change non-domain domain name to localhost Fix correct handler notify naming Allow setting different subdomain alias than name Add meta information
This commit is contained in:
parent
80185e39dd
commit
ebd995b8c4
9 changed files with 226 additions and 0 deletions
36
roles/wallabag/templates/docker-stack.yml.j2
Normal file
36
roles/wallabag/templates/docker-stack.yml.j2
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
version: "3.7"
|
||||
|
||||
services:
|
||||
app:
|
||||
image: {{ stack_image }}:{{ wallabag_version }}
|
||||
networks:
|
||||
- "{{ docker_swarm_public_network_name }}"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost"]
|
||||
interval: 1m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 1m
|
||||
volumes:
|
||||
- data:/var/www/wallabag/data
|
||||
environment:
|
||||
- SYMFONY__ENV__FOSUSER_REGISTRATION=false
|
||||
{% if server_domain is not undefined and not none %}
|
||||
- SYMFONY__ENV__DOMAIN_NAME={{ (wallabag_use_https == True) | ternary('https', 'http') }}://wallabag.{{ server_domain }}
|
||||
{% else %}
|
||||
- SYMFONY__ENV__DOMAIN_NAME={{ (wallabag_use_https == True) | ternary('https', 'http') }}://localhost
|
||||
{% endif %}
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 20s
|
||||
timeout: 3s
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
networks:
|
||||
"{{ docker_swarm_public_network_name }}":
|
||||
external: true
|
||||
38
roles/wallabag/templates/upstream.json.j2
Normal file
38
roles/wallabag/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:80"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue