forked from davestephens/ansible-nas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnextcloud.yml
48 lines (46 loc) · 1.33 KB
/
nextcloud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
- name: Create Nextcloud directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ nextcloud_data_directory }}/nextcloud"
- "{{ nextcloud_data_directory }}/mysql"
- name: Nextcloud Mysql Docker Container
docker_container:
name: nextcloud-mysql
image: mysql:5.7
pull: true
volumes:
- "{{ nextcloud_data_directory }}/mysql:/var/lib/mysql:rw"
env:
MYSQL_DATABASE: "nextcloud"
MYSQL_USER: "nextcloud-user"
MYSQL_PASSWORD: "nextcloud-pass"
MYSQL_ROOT_PASSWORD: "nextcloud-secret"
restart_policy: unless-stopped
memory: 1g
- name: Nextcloud Docker Container
docker_container:
name: nextcloud
image: nextcloud:14
pull: true
links:
- nextcloud-mysql:mysql
volumes:
- "{{ nextcloud_data_directory }}/nextcloud:/var/www/html:rw"
ports:
- "{{ nextcloud_port }}:80"
env:
MYSQL_HOST: "mysql"
MYSQL_DATABASE: "nextcloud"
MYSQL_USER: "nextcloud-user"
MYSQL_PASSWORD: "nextcloud-pass"
NEXTCLOUD_TRUSTED_DOMAINS: "nextcloud.{{ ansible_nas_domain }}"
restart_policy: unless-stopped
memory: 1g
labels:
traefik.backend: "nextcloud"
traefik.frontend.rule: "Host:nextcloud.{{ ansible_nas_domain }}"
traefik.enable: "{{ nextcloud_available_externally }}"
traefik.port: "80"