/
/
/
Ansible role that provisions my storage server.
1# Nextcloud Docker Compose Configuration
2# Generated by Ansible - DO NOT EDIT MANUALLY
3
4
5services:
6 nextcloud-db:
7 image: {{ nextcloud_mariadb_image }}:{{ nextcloud_mariadb_version }}
8 container_name: nextcloud-db
9 restart: unless-stopped
10 command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
11
12 env_file:
13 - .env
14
15 volumes:
16 - {{ nextcloud_mariadb_config_dir }}:/var/lib/mysql
17
18 networks:
19 - {{ storage_docker_network }}
20
21 healthcheck:
22 test: ["CMD", "bash", "-c", "mariadb-admin ping --user=root --password=\"$$MYSQL_ROOT_PASSWORD\""]
23 interval: {{ health_check_interval }}
24 timeout: {{ health_check_timeout }}
25 retries: {{ health_check_retries }}
26 start_period: {{ health_check_start_period }}
27
28 deploy:
29 resources:
30 limits:
31 memory: {{ nextcloud_db_memory_limit }}
32 cpus: "{{ nextcloud_db_cpu_limit }}"
33
34 nextcloud-redis:
35 image: {{ nextcloud_redis_image }}:{{ nextcloud_redis_version }}
36 container_name: nextcloud-redis
37 restart: unless-stopped
38
39 volumes:
40 - {{ nextcloud_redis_config_dir }}:/data
41
42 networks:
43 - {{ storage_docker_network }}
44
45 healthcheck:
46 test: ["CMD", "redis-cli", "ping"]
47 interval: {{ health_check_interval }}
48 timeout: {{ health_check_timeout }}
49 retries: {{ health_check_retries }}
50 start_period: 10s
51
52 deploy:
53 resources:
54 limits:
55 memory: {{ nextcloud_redis_memory_limit }}
56 cpus: "{{ nextcloud_redis_cpu_limit }}"
57
58 nextcloud-elasticsearch:
59 image: {{ nextcloud_elasticsearch_image }}:{{ nextcloud_elasticsearch_version }}
60 container_name: nextcloud-elasticsearch
61 restart: unless-stopped
62
63 environment:
64 - discovery.type=single-node
65 - bootstrap.memory_lock=true
66 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
67 - ELASTIC_PASSWORD=${NEXTCLOUD_ELASTICSEARCH_PASSWORD}
68 - xpack.security.enabled=true
69
70 ulimits:
71 memlock:
72 soft: -1
73 hard: -1
74
75 volumes:
76 - {{ nextcloud_elasticsearch_config_dir }}:/usr/share/elasticsearch/data
77
78 networks:
79 - {{ storage_docker_network }}
80
81 healthcheck:
82 test: ["CMD", "curl", "-sf", "-u", "elastic:${NEXTCLOUD_ELASTICSEARCH_PASSWORD}", "http://localhost:9200/_cluster/health"]
83 interval: {{ health_check_interval }}
84 timeout: {{ health_check_timeout }}
85 retries: {{ health_check_retries }}
86 start_period: {{ health_check_start_period }}
87
88 deploy:
89 resources:
90 limits:
91 memory: {{ nextcloud_elasticsearch_memory_limit }}
92 cpus: "{{ nextcloud_elasticsearch_cpu_limit }}"
93
94 nextcloud-collabora:
95 image: {{ nextcloud_collabora_image }}:{{ nextcloud_collabora_version }}
96 container_name: nextcloud-collabora
97 restart: unless-stopped
98
99 environment:
100 - aliasgroup1=http://nextcloud:{{ nextcloud_port }}
101 - server_name=nextcloud.home
102 - "extra_params={{ nextcloud_collabora_extra_params }}"
103 - dictionaries=en_US
104
105 cap_add:
106 - MKNOD
107
108 ports:
109 - "{{ nextcloud_collabora_host_port }}:{{ nextcloud_collabora_port }}"
110
111 networks:
112 - {{ storage_docker_network }}
113
114 healthcheck:
115 test: ["CMD", "curl", "-sf", "http://localhost:9980/hosting/discovery"]
116 interval: {{ health_check_interval }}
117 timeout: {{ health_check_timeout }}
118 retries: {{ health_check_retries }}
119 start_period: {{ health_check_start_period }}
120
121 deploy:
122 resources:
123 limits:
124 memory: {{ nextcloud_collabora_memory_limit }}
125 cpus: "{{ nextcloud_collabora_cpu_limit }}"
126
127 nextcloud-imaginary:
128 image: {{ nextcloud_imaginary_image }}:{{ nextcloud_imaginary_version }}
129 container_name: nextcloud-imaginary
130 restart: unless-stopped
131
132 networks:
133 - {{ storage_docker_network }}
134
135 healthcheck:
136 test: ["CMD", "curl", "-sf", "http://localhost:9000/health"]
137 interval: {{ health_check_interval }}
138 timeout: {{ health_check_timeout }}
139 retries: {{ health_check_retries }}
140 start_period: 10s
141
142 deploy:
143 resources:
144 limits:
145 memory: {{ nextcloud_imaginary_memory_limit }}
146 cpus: "{{ nextcloud_imaginary_cpu_limit }}"
147
148 nextcloud:
149 image: {{ nextcloud_image }}:{{ nextcloud_version }}
150 container_name: nextcloud
151 restart: unless-stopped
152 depends_on:
153 nextcloud-db:
154 condition: service_healthy
155 nextcloud-redis:
156 condition: service_healthy
157
158 env_file:
159 - .env
160
161 extra_hosts:
162 - "nextcloud.home:host-gateway"
163
164 ports:
165 - "{{ nextcloud_host_port }}:{{ nextcloud_port }}"
166
167 volumes:
168 - {{ nextcloud_config_dir }}/html:/var/www/html
169 - {{ nextcloud_data_dir }}:/var/www/html/data
170
171 networks:
172 - {{ storage_docker_network }}
173
174 healthcheck:
175 test: ["CMD", "curl", "-f", "http://localhost/status.php"]
176 interval: {{ health_check_interval }}
177 timeout: {{ health_check_timeout }}
178 retries: {{ health_check_retries }}
179 start_period: {{ health_check_start_period }}
180
181 deploy:
182 resources:
183 limits:
184 memory: {{ nextcloud_memory_limit }}
185 cpus: "{{ nextcloud_cpu_limit }}"
186
187networks:
188 {{ storage_docker_network }}:
189 external: true
190