ansible-role-minio/templates/minio-docker-compose.yml.j2

66 lines
1.6 KiB
Plaintext
Raw Normal View History

2021-11-08 19:28:32 +01:00
version: '3.7'
2021-11-08 12:23:34 +01:00
networks:
2021-11-08 19:28:32 +01:00
{{ minio_docker_network }}:
2021-11-08 12:23:34 +01:00
{% if minio_behind_haproxy %}
haproxy-public:
external: true
{% endif %}
2021-11-08 19:28:32 +01:00
secrets:
minio_secret_key:
external: true
minio_access_key:
external: true
2021-11-08 12:23:34 +01:00
services:
{% for i in minio_server_instances %}
{{ minio_docker_service_server_name }}{{ i }}:
2021-11-08 19:28:32 +01:00
hostname: {{ minio_docker_service_server_name }}{{ i }}
2021-11-08 12:23:34 +01:00
image: {{ minio_docker_server_image }}
2021-11-08 19:28:32 +01:00
command: server --console-address ":9001" http://{{ minio_docker_service_server_name }}{1...8}/{{ minio_data_prefix }}{3...4}
{% if not minio_docker_swarm_dnsrr %}
ports:
- 9000
{% endif %}
2021-11-08 12:23:34 +01:00
networks:
- {{ minio_docker_network }}
{% if minio_behind_haproxy %}
- haproxy-public
{% endif %}
environment:
2021-11-08 19:28:32 +01:00
MINIO_ROOT_USER_FILE: minio_access_key
MINIO_ROOT_PASSWORD_FILE: minio_secret_key
secrets:
- minio_access_key
- minio_secret_key
2021-11-08 12:23:34 +01:00
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
2021-11-08 19:28:32 +01:00
retries: 5
2021-11-08 12:23:34 +01:00
volumes:
{% for vol in minio_disk_volumes %}
- {{ minio_volume_prefix }}/{{ vol }}:{{ minio_data_prefix }}{{ vol }}
{% endfor %}
2021-11-08 19:28:32 +01:00
2021-11-08 12:23:34 +01:00
deploy:
mode: replicated
replicas: 1
2021-11-08 19:28:32 +01:00
{% if minio_docker_swarm_dnsrr %}
2021-11-08 12:23:34 +01:00
endpoint_mode: dnsrr
2021-11-08 19:28:32 +01:00
{% endif %}
2021-11-08 12:23:34 +01:00
placement:
constraints:
- node.role == worker
- node.labels.minio == minio{{ i }}
restart_policy:
condition: on-failure
delay: 5s
2021-11-08 19:28:32 +01:00
max_attempts: 20
2021-11-08 12:23:34 +01:00
window: 120s
logging:
driver: 'journald'
{% endfor %}