/
/
/
Ansible role that provisions my storage server.
1# Restic Backup Server Docker Compose Configuration
2# Generated by Ansible - DO NOT EDIT MANUALLY
3
4version: '3.8'
5
6services:
7 restic-server:
8 image: {{ restic_image }}:{{ restic_version }}
9 container_name: restic-server
10 restart: unless-stopped
11
12 # Environment Configuration
13 env_file:
14 - .env
15
16 # Port Mapping
17 ports:
18 - "{{ restic_backup_host_port }}:{{ restic_backup_port }}"
19
20 # Volume Mounts
21 volumes:
22 - {{ restic_backup_data_dir }}:/data
23 - {{ restic_backup_htpasswd_file }}:/data/.htpasswd:ro
24
25 # Resource Limits
26 deploy:
27 resources:
28 limits:
29 memory: {{ default_memory_limit }}
30 cpus: '{{ default_cpu_limit }}'
31
32 # Network
33 networks:
34 - {{ storage_docker_network }}
35
36 # Command arguments
37 command: >
38 --listen 0.0.0.0:{{ restic_backup_port }}
39 --path /data
40 {% if restic_backup_username is defined and restic_backup_username != "" %}
41 --htpasswd-file /data/.htpasswd
42 {% endif %}
43 --no-auth=false
44 --append-only=false
45 --private-repos=true
46
47 # Health Check
48 healthcheck:
49 test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:{{ restic_backup_port }}/"]
50 interval: {{ health_check_interval }}
51 timeout: {{ health_check_timeout }}
52 retries: {{ health_check_retries }}
53 start_period: 30s
54
55networks:
56 {{ storage_docker_network }}:
57 external: true