73 lines
3.5 KiB
Django/Jinja
73 lines
3.5 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:
|
|
- STAMPINGS_SERVER_PROTOCOL={{ epas_client_timbrature_stampings_server_protocol }} # Protocollo per prelevare le timbrature. Possibili valori: smartclock, local, ftp, sftp
|
|
- 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
|
|
- REGEX_STAMPING='{{ epas_client_timbrature_regex_stamping }}'
|
|
- OFFSET_ANNO_BADGE={{ epas_client_timbrature_offset_anno_badge }} # Default: 2000
|
|
- FIX_CAUSALE_PAUSA_PRANZO={{ epas_client_timbrature_fix_causale_pausa_pranzo}} # Default: False
|
|
- MAPPING_CAUSALI_CLIENT_SERVER='{{ epas_client_timbrature_mapping_causali_client_server }}' # Default: {'0000': None, '0001': 'motiviDiServizio', '0007': 'pausaPranzo'}
|
|
- CAUSALE_PAUSA_PRANZO_MIN_HOUR={{ epas_client_timbrature_causale_pausa_pranzo_min_hour }} # Default: 12
|
|
- CAUSALE_PAUSA_PRANZO_MAX_HOUR={{ epas_client_timbrature_causale_pausa_pranzo_max_hour }} # Default: 15
|
|
- SEND_ALL_STAMPINGS_EVERYTIME={{ epas_client_timbrature_send_all_stampings_everytime }}
|
|
#- 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'
|