-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnextcloud-stack-4-swarm.yml
More file actions
146 lines (137 loc) · 3.22 KB
/
nextcloud-stack-4-swarm.yml
File metadata and controls
146 lines (137 loc) · 3.22 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# stack name "nextcloud"
version: '3.7'
x-environment: &common-vars
MYSQL_PASSWORD:
MYSQL_DATABASE:
MYSQL_USER:
MYSQL_ROOT_PASSWORD:
TZ: Europe/Rome
UPLOAD_MAX_SIZE: 20G
x-default-opts:
&default-opts
deploy:
restart_policy:
condition: on-failure
delay: 5s
#max_attempts: 3
window: 20s
services:
nginx:
image: nginx:1.18
# restart: unless-stopped
hostname: nginx
<<: *default-opts
ports:
- target: 80
published: 89
protocol: tcp
mode: host
volumes:
- /srv/data/nextcloud/nginx/nextcloud.conf:/etc/nginx/nginx.conf:ro
# - /srv/data/website/nginx/app.conf:/etc/nginx/conf.d/app.conf:ro
- app:/var/www/html
- logs:/var/log/nginx
- /srv/data/nextcloud/nginx/entrypoint.sh:/entrypoint.sh:ro
environment:
TZ: Europe/Rome
WAITFOR: app:ping
depends_on:
- app
entrypoint: ["/entrypoint.sh"]
command: ["nginx", "-g", "daemon off;"]
# healthcheck:
# test: ["CMD", "/bin/sh", "-c", "nc -w 7 -zv 0.0.0.0 80 || (echo \"Very bad things are happening here...\" && exit 1)"]
# interval: 30s
# timeout: 10s
# start_period: 90s
# retries: 6
stop_grace_period: 20s
app:
image: nextcloud:17-fpm
hostname: app
<<: *default-opts
volumes:
- app:/var/www/html
environment:
TZ: Europe/Rome
REDIS_HOST: redis
MYSQL_HOST : db
<< : *common-vars
depends_on:
- db
- redis
stop_grace_period: 20s
cron:
image: nextcloud:17-fpm
hostname: cron
<<: *default-opts
volumes:
- app:/var/www/html
environment:
TZ: Europe/Rome
<< : *common-vars
entrypoint: /cron.sh
depends_on:
- db
- redis
stop_grace_period: 20s
db:
image: mariadb:10
hostname: db
<<: *default-opts
volumes:
- db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD_FILE: /var/lib/mysql/db-root.pwd
MYSQL_PASSWORD_FILE: /var/lib/mysql/db-nextcloud.pwd
MYSQL_DATABASE_FILE: /var/lib/mysql/db-name.txt
MYSQL_USER_FILE: /var/lib/mysql/db-user.txt
TZ: Europe/Rome
healthcheck:
test: ["CMD", "/bin/bash", "-c", "read p < $$MYSQL_PASSWORD_FILE ; read u < $$MYSQL_USER_FILE ; mysql -p$$p -u$$u -e status | grep Uptime || (echo \"MariaDB is down\" && exit 1)"]
interval: 30s
timeout: 30s
start_period: 5s
retries: 20
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
redis:
image: redis:5-alpine
hostname: redis
<<: *default-opts
environment:
TZ: Europe/Rome
volumes:
- redis:/data
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
<< : *common-vars
PMA_HOST: db
PMA_PORT: 3306
ports:
- '8288:80'
depends_on:
- db
volumes:
common_data:
driver: local
logs:
driver: local
driver_opts:
type: none
o: bind
device: /srv/data/logs/nextcloud
db:
driver: local
driver_opts:
type: none
o: bind
device: /srv/data/databases/nextcloud
app:
driver: local
driver_opts:
type: none
o: bind
device: /srv/data/nextcloud/app
redis:
driver: local