cloudserve-infrastructure/roles/diun/templates/docker-stack.yml.j2
2024-06-25 12:20:46 +02:00

51 lines
1.9 KiB
Django/Jinja

version: '3.4'
services:
app:
image: crazymax/diun:latest
# healthcheck:
# test: ["CMD", "wget", "--spider", "-q", "127.0.0.1"]
# interval: 1m
# timeout: 10s
# retries: 3
# start_period: 1m
command: serve
volumes:
- "data:/data"
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- "TZ={{ diun_tz }}"
- "LOG_LEVEL={{ diun_log_level }}"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=0 */6 * * *"
- "DIUN_WATCH_JITTER=30s"
- "DIUN_PROVIDERS_SWARM=true"
- "DIUN_PROVIDERS_SWARM_WATCHBYDEFAULT={{ diun_watch_swarm_by_default }}"
{% if diun_notif_matrix_user is not undefined and not None and diun_notif_matrix_password is not undefined and not None and diun_notif_matrix_roomid is not undefined and not None %}
- "DIUN_NOTIF_MATRIX_HOMESERVERURL={{ diun_notif_matrix_url }}"
- "DIUN_NOTIF_MATRIX_USER={{ diun_notif_matrix_user }}"
- "DIUN_NOTIF_MATRIX_PASSWORD={{ diun_notif_matrix_password }}"
- "DIUN_NOTIF_MATRIX_ROOMID={{ diun_notif_matrix_roomid }}"
{% endif %}
{% if diun_notif_mail_username is not undefined and not None and diun_notif_mail_password is not undefined and not None and diun_notif_mail_from is not undefined and not None and diun_notif_mail_to is not undefined and not None %}
- "DIUN_NOTIF_MAIL_HOST={{ diun_notif_mail_host }}"
- "DIUN_NOTIF_MAIL_PORT={{ diun_notif_mail_port }}"
- "DIUN_NOTIF_MAIL_USERNAME={{ diun_notif_mail_username }}"
- "DIUN_NOTIF_MAIL_PASSWORD={{ diun_notif_mail_password }}"
- "DIUN_NOTIF_MAIL_FROM={{ diun_notif_mail_from }}"
- "DIUN_NOTIF_MAIL_TO={{ diun_notif_mail_to }}"
{% endif %}
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.role == manager
volumes:
data:
networks:
"{{ docker_swarm_public_network_name }}":
external: true