xoxys.vaultwarden_docker/templates/services/compose.yml.j2

106 lines
4.9 KiB
Plaintext
Raw Normal View History

2020-01-17 21:00:14 +00:00
#jinja2:lstrip_blocks: True
{{ ansible_managed | comment }}
version: '2.1'
services:
bitwardenrs:
container_name: {{ bitwardenrs_container_name }}
image: {{ bitwardenrs_image }}
restart: unless-stopped
ports:
- {{ bitwardenrs_exposed_ip + ':' if bitwardenrs_exposed_ip is defined else '' }}{{ bitwardenrs_exposed_port }}:8080
volumes:
- data:/app/data
{% if bitwardenrs_extra_hosts | default([]) %}
extra_hosts:
{% for host in bitwardenrs_extra_hosts %}
- {{ '"' + host + '"' }}
{% endfor %}
{% endif %}
environment:
- BITWARDENRS_BASE_URL={{ bitwardenrs_base_url }}
2020-01-17 21:30:42 +00:00
- BITWARDENRS_DATABASE_URL=postgresql://{{ bitwardenrs_db_user }}:{{ bitwardenrs_db_password }}@{{ bitwardenrs_db_server }}:{{ bitwardenrs_db_port }}/{{ bitwardenrs_db_name }}?sslmode={{ bitwardenrs_db_ssl_mode }}
2020-01-17 21:00:14 +00:00
{% if bitwardenrs_templates_folder is defined and bitwardenrs_templates_folder %}
- BITWARDENRS_TEMPLATES_FOLDER={{ bitwardenrs_templates_folder }}
{% endif %}
- BITWARDENRS_RELOAD_TEMPLATES={{ bitwardenrs_reload_templates }}
- BITWARDENRS_IP_HEADER={{ bitwardenrs_ip_header }}
- BITWARDENRS_ICON_CACHE_TTL={{ bitwardenrs_icon_cache_ttl }}
- BITWARDENRS_ICON_CACHE_NEGTTL="{{ bitwardenrs_icon_cache_negttl }}"
- BITWARDENRS_WEB_VAULT_ENABLED={{ bitwardenrs_web_vault_enabled }}
- BITWARDENRS_EXTENDED_LOGGING={{ bitwardenrs_extended_logging }}
- BITWARDENRS_LOG_LEVEL={{ bitwardenrs_log_level }}
- BITWARDENRS_DISABLE_ICON_DOWNLOAD={{ bitwardenrs_disable_icon_download }}
- BITWARDENRS_ICON_DOWNLOAD_TIMEOUT={{ bitwardenrs_icon_download_timeout }}
{% if bitwardenrs_icon_blacklist_regexl is defined and bitwardenrs_icon_blacklist_regexl %}
- BITWARDENRS_ICON_BLACKLIST_REGEXL={{ bitwardenrs_icon_blacklist_regexl }}
{% endif %}
- BITWARDENRS_ICON_BLACKLIST_NON_GLOBAL_IPS={{ bitwardenrs_icon_blacklist_non_global_ips }}
- BITWARDENRS_DISABLE_2FA_REMEMBER={{ bitwardenrs_disable_2fa_remember }}
- BITWARDENRS_SIGNUPS_ALLOWED={{ bitwardenrs_signups_allowed }}
- BITWARDENRS_SIGNUPS_VERIFY={{ bitwardenrs_signups_verify }}
- BITWARDENRS_SIGNUPS_VERIFY_RESEND_TIME={{ bitwardenrs_signups_verify_resend_time }}
- BITWARDENRS_SIGNUPS_VERIFY_RESEND_LIMIT={{ bitwardenrs_signups_verify_resend_limit }}
{% if bitwardenrs_signups_domains_whitelist is defined and bitwardenrs_signups_domains_whitelist %}
- BITWARDENRS_SIGNUPS_DOMAINS_WHITELIST={{ bitwardenrs_signups_domains_whitelist }}
{% endif %}
- BITWARDENRS_INVITATIONS_ALLOWED={{ bitwardenrs_invitations_allowed }}
{% if bitwardenrs_admin_token is defined and bitwardenrs_admin_token %}
- BITWARDENRS_ADMIN_TOKEN={{ bitwardenrs_admin_token }}
{% endif %}
- BITWARDENRS_PASSWORD_ITERATIONS={{ bitwardenrs_password_iterations }}
- BITWARDENRS_SHOW_PASSWORD_HINT={{ bitwardenrs_show_password_hint }}
- BITWARDENRS_AUTHENTICATOR_DISABLE_TIME_DRIFT={{ bitwardenrs_authenticator_disable_time_drift }}
{% if bitwardenrs_smtp_host is defined and bitwardenrs_smtp_host %}
- BITWARDENRS_SMTP_HOST={{ bitwardenrs_smtp_host }}
{% endif %}
- BITWARDENRS_SMTP_FROM={{ bitwardenrs_smtp_from }}
- BITWARDENRS_SMTP_FROM_NAME={{ bitwardenrs_smtp_from_name }}
- BITWARDENRS_SMTP_PORT={{ bitwardenrs_smtp_port }}
- BITWARDENRS_SMTP_SSL={{ bitwardenrs_smtp_ssl }}
{% if bitwardenrs_smtp_username is defined and bitwardenrs_smtp_username %}
- BITWARDENRS_SMTP_USERNAME={{ bitwardenrs_smtp_username }}
- BITWARDENRS_SMTP_PASSWORD={{ bitwardenrs_smtp_password }}
{% endif %}
- BITWARDENRS_SMTP_AUTH_MECHANISM={{ bitwardenrs_smtp_auth_mechanism }}
- BITWARDENRS_SMTP_TIMEOUT={{ bitwardenrs_smtp_timeout }}
{% if bitwardenrs_memory_limit is defined %}
mem_limit: {{ bitwardenrs_memory_limit }}
{% endif %}
{% if bitwardenrs_memory_reservation is defined %}
mem_reservation: {{ bitwardenrs_memory_reservation }}
{% endif %}
{% if bitwardenrs_cpu_shares is defined %}
cpu_shares: {{ bitwardenrs_cpu_shares }}
{% endif %}
{% if not bitwardenrs_cap_add | length == 0 %}
cap_add:
{% for item in bitwardenrs_cap_add %}
- {{ item }}
{% endfor %}
{% endif %}
{% if not bitwardenrs_cap_drop | length == 0 %}
cap_drop:
{% for item in bitwardenrs_cap_drop %}
- {{ item }}
{% endfor %}
{% endif %}
{% if not bitwardenrs_security_opt | length == 0 %}
security_opt:
{% for item in bitwardenrs_security_opt %}
- {{ item }}
{% endfor %}
{% endif %}
healthcheck:
{% for key, value in bitwardenrs_healthcheck.items() %}
{{ key }}: {{ value }}
{% endfor %}
{% if bitwardenrs_pids_limit is defined %}
pids_limit: {{ bitwardenrs_pids_limit }}
{% endif %}
volumes:
data:
driver: local