/
/
/
Ansible role that provisions my storage server.
1# Arr Stack with Gluetun VPN Docker Compose Configuration
2# Generated by Ansible - DO NOT EDIT MANUALLY
3
4version: '3.8'
5
6services:
7{% if gluetun_enabled %}
8 gluetun:
9 image: {{ gluetun_image }}:{{ gluetun_version }}
10 container_name: gluetun
11 restart: unless-stopped
12
13 # VPN Configuration
14 env_file:
15 - .env
16
17 # Capabilities for VPN
18 cap_add:
19 - NET_ADMIN
20
21 # Port Mapping for all Arr services
22 ports:
23 {% if sonarr_enabled %}
24 - "{{ sonarr_host_port }}:{{ sonarr_port }}"
25 {% endif %}
26 {% if radarr_enabled %}
27 - "{{ radarr_host_port }}:{{ radarr_port }}"
28 {% endif %}
29 {% if prowlarr_enabled %}
30 - "{{ prowlarr_host_port }}:{{ prowlarr_port }}"
31 {% endif %}
32 {% if readarr_enabled %}
33 - "{{ readarr_host_port }}:{{ readarr_port }}"
34 {% endif %}
35
36 # Volume Mounts
37 volumes:
38 - {{ gluetun_config_dir }}:/gluetun
39
40 # Network
41 networks:
42 - {{ storage_docker_network }}
43
44 # Health Check
45 healthcheck:
46 test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://www.google.com"]
47 interval: 30s
48 timeout: 10s
49 retries: 3
50 start_period: 60s
51{% endif %}
52
53{% if sonarr_enabled %}
54 sonarr:
55 image: {{ sonarr_image }}:{{ sonarr_version }}
56 container_name: sonarr
57 restart: unless-stopped
58 depends_on:
59 {% if gluetun_enabled %}
60 - gluetun
61 {% endif %}
62
63 # Environment Configuration
64 env_file:
65 - .env
66
67 {% if gluetun_enabled %}
68 # Use Gluetun network stack
69 network_mode: "service:gluetun"
70 {% else %}
71 # Direct port mapping when VPN disabled
72 ports:
73 - "{{ sonarr_host_port }}:{{ sonarr_port }}"
74 networks:
75 - {{ storage_docker_network }}
76 {% endif %}
77
78 # Volume Mounts
79 volumes:
80 - {{ sonarr_config_dir }}:/config
81 - {{ sonarr_tv_dir }}:/tv
82 - {{ arr_downloads_dir }}:/downloads
83
84 # Resource Limits
85 deploy:
86 resources:
87 limits:
88 memory: {{ arr_memory_limit }}
89 cpus: '{{ arr_cpu_limit }}'
90
91 {% if not gluetun_enabled %}
92 # Health Check (only when not using Gluetun)
93 healthcheck:
94 test: ["CMD", "curl", "-f", "http://localhost:{{ sonarr_port }}/ping"]
95 interval: {{ health_check_interval }}
96 timeout: {{ health_check_timeout }}
97 retries: {{ health_check_retries }}
98 {% endif %}
99{% endif %}
100
101{% if radarr_enabled %}
102 radarr:
103 image: {{ radarr_image }}:{{ radarr_version }}
104 container_name: radarr
105 restart: unless-stopped
106 depends_on:
107 {% if gluetun_enabled %}
108 - gluetun
109 {% endif %}
110
111 # Environment Configuration
112 env_file:
113 - .env
114
115 {% if gluetun_enabled %}
116 # Use Gluetun network stack
117 network_mode: "service:gluetun"
118 {% else %}
119 # Direct port mapping when VPN disabled
120 ports:
121 - "{{ radarr_host_port }}:{{ radarr_port }}"
122 networks:
123 - {{ storage_docker_network }}
124 {% endif %}
125
126 # Volume Mounts
127 volumes:
128 - {{ radarr_config_dir }}:/config
129 - {{ radarr_movies_dir }}:/movies
130 - {{ arr_downloads_dir }}:/downloads
131
132 # Resource Limits
133 deploy:
134 resources:
135 limits:
136 memory: {{ arr_memory_limit }}
137 cpus: '{{ arr_cpu_limit }}'
138
139 {% if not gluetun_enabled %}
140 # Health Check (only when not using Gluetun)
141 healthcheck:
142 test: ["CMD", "curl", "-f", "http://localhost:{{ radarr_port }}/ping"]
143 interval: {{ health_check_interval }}
144 timeout: {{ health_check_timeout }}
145 retries: {{ health_check_retries }}
146 {% endif %}
147{% endif %}
148
149{% if prowlarr_enabled %}
150 prowlarr:
151 image: {{ prowlarr_image }}:{{ prowlarr_version }}
152 container_name: prowlarr
153 restart: unless-stopped
154 depends_on:
155 {% if gluetun_enabled %}
156 - gluetun
157 {% endif %}
158
159 # Environment Configuration
160 env_file:
161 - .env
162
163 {% if gluetun_enabled %}
164 # Use Gluetun network stack
165 network_mode: "service:gluetun"
166 {% else %}
167 # Direct port mapping when VPN disabled
168 ports:
169 - "{{ prowlarr_host_port }}:{{ prowlarr_port }}"
170 networks:
171 - {{ storage_docker_network }}
172 {% endif %}
173
174 # Volume Mounts
175 volumes:
176 - {{ prowlarr_config_dir }}:/config
177
178 # Resource Limits
179 deploy:
180 resources:
181 limits:
182 memory: {{ arr_memory_limit }}
183 cpus: '{{ arr_cpu_limit }}'
184
185 {% if not gluetun_enabled %}
186 # Health Check (only when not using Gluetun)
187 healthcheck:
188 test: ["CMD", "curl", "-f", "http://localhost:{{ prowlarr_port }}/ping"]
189 interval: {{ health_check_interval }}
190 timeout: {{ health_check_timeout }}
191 retries: {{ health_check_retries }}
192 {% endif %}
193{% endif %}
194
195{% if readarr_enabled %}
196 readarr:
197 image: {{ readarr_image }}:{{ readarr_version }}
198 container_name: readarr
199 restart: unless-stopped
200 depends_on:
201 {% if gluetun_enabled %}
202 - gluetun
203 {% endif %}
204
205 # Environment Configuration
206 env_file:
207 - .env
208
209 {% if gluetun_enabled %}
210 # Use Gluetun network stack
211 network_mode: "service:gluetun"
212 {% else %}
213 # Direct port mapping when VPN disabled
214 ports:
215 - "{{ readarr_host_port }}:{{ readarr_port }}"
216 networks:
217 - {{ storage_docker_network }}
218 {% endif %}
219
220 # Volume Mounts
221 volumes:
222 - {{ readarr_config_dir }}:/config
223 - {{ readarr_books_dir }}:/books
224 - {{ arr_downloads_dir }}:/downloads
225
226 # Resource Limits
227 deploy:
228 resources:
229 limits:
230 memory: {{ arr_memory_limit }}
231 cpus: '{{ arr_cpu_limit }}'
232
233 {% if not gluetun_enabled %}
234 # Health Check (only when not using Gluetun)
235 healthcheck:
236 test: ["CMD", "curl", "-f", "http://localhost:{{ readarr_port }}/ping"]
237 interval: {{ health_check_interval }}
238 timeout: {{ health_check_timeout }}
239 retries: {{ health_check_retries }}
240 {% endif %}
241{% endif %}
242
243networks:
244 {{ storage_docker_network }}:
245 external: true