ansible-role-epas-client-ti.../templates/epas-client-timbrature-dock...

65 lines
2.6 KiB
Django/Jinja

version: '3.2'
{% if epas_client_timbrature_behind_haproxy %}
networks:
{{ epas_client_timbrature_haproxy_public_net }}:
external: true
{% endif %}
volumes:
{{ epas_client_timbrature_data_volume }}:
{% if epas_client_timbrature_data_remote_volume %}
driver: local
driver_opts:
type: nfs4
o: "{{ epas_client_timbrature_data_remote_volume_opts }}"
device: "{{ epas_client_timbrature_data_remote_volume_dev }}"
{% endif %}
services:
{{ epas_client_timbrature_service_name }}:
image: {{ epas_client_timbrature_docker_client_timbrature_image }}
{% if epas_client_timbrature_behind_haproxy %}
networks:
- {{ epas_client_timbrature_haproxy_public_net }}
{% endif %}
volumes:
- {{ epas_client_timbrature_data_volume }}:/client/data
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
environment:
- FTP_SERVER_NAME={{ epas_client_timbrature_ftp_server_name }} # Obbligatorio
- FTP_USERNAME={{ epas_client_timbrature_ftp_username }} # Obbligatorio
- FTP_PASSWORD={{ epas_client_timbrature_ftp_pwd }} # Obbligatorio
- FTP_SERVER_DIR={{ epas_client_timbrature_ftp_server_dir }} # Opzionale. default: AT
- FTP_FILE_PREFIX={{ epas_client_timbrature_ftp_file_prefix }} # Opzionale. default: AT
- SERVER_HOST={{ epas_client_timbrature_epas_server_name }} # default: link al container con alias epas (docker-compose v2)
- SERVER_PROTOCOL={{ epas_client_timbrature_epas_server_protocol }} # default: http. (http, https)
- SERVER_PORT={{ epas_client_timbrature_epas_server_port }} # default: 9000
- EPAS_CLIENT_USER={{ epas_client_timbrature_user }} # utente configurato in epas dentro sorgenti timbrature
- EPAS_CLIENT_PASSWORD={{ epas_client_timbrature_password }}
- LOG_LEVEL={{ epas_client_timbrature_loglevel }} # Default: INFO
#- CRON=*/30 7-22 * * * # Default: ogni mezz'ora tra le 7 e le 22. utilizzare il formato richiesto dal crontab. Riferimenti -> https://en.wikipedia.org/wiki/Cron#Examples
deploy:
mode: replicated
replicas: 1
{% if epas_client_timbrature_behind_haproxy %}
endpoint_mode: dnsrr
{% endif %}
placement:
constraints:
- node.role == worker
{% if not epas_client_timbrature_data_remote_volume %}
- {{ epas_client_timbrature_node_constraints }}
{% endif %}
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
logging:
driver: 'journald'