-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
216 lines (204 loc) · 6.64 KB
/
docker-compose.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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: nextcloud
# Docs ########################################################################
# https://github.com/nextcloud/docker
# Volumes #####################################################################
volumes:
nextcloud_caddy_data:
external: true
# Comment out and use code below to use a bind mount for data folder
nextcloud_data:
external: true
# Use this, if using bind mount
# nextcloud_data:
# driver: local
# driver_opts:
# type: none
# o: bind
# device: "${PWD}/data"
nextcloud_db_data:
external: true
# Networks ####################################################################
networks:
net:
driver: bridge
attachable: true
# Uncomment, if imaginary stack should be used (see imaginary.yml)
# img:
# name: imaginary_imaginary
# external: true
# Services ####################################################################
services:
# Caddy ---------------------------------------------------------------------
caddy:
image: caddy:alpine
pull_policy: always
restart: unless-stopped
ports:
- 80:80
- 443:443
environment:
TLS_DOMAINS: "${TLS_DOMAINS:?TLS_DOMAINS not set}"
ADMIN_EMAIL: "${ADMIN_EMAIL:?ADMIN_EMAIL not set}"
CADDY_TLS: "${CADDY_TLS}"
networks:
- net
volumes:
- nextcloud_caddy_data:/data
- nextcloud_data:/var/www/html:ro
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# Postgres ------------------------------------------------------------------
db:
image: postgres:${POSTGRES_VERSION:?POSTGRES_VERSION not set}
pull_policy: always
restart: unless-stopped
networks:
- net
volumes:
- nextcloud_db_data:/var/lib/postgresql/data
# ports:
# - 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:?POSTGRES_USER not set} -d ${POSTGRES_DB:?POSTGRES_DB not set}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
environment:
POSTGRES_DB: ${POSTGRES_DB:?POSTGRES_DB not set}
POSTGRES_USER: ${POSTGRES_USER:?POSTGRES_USER not set}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD not set}
# psql performance tuning: https://pgtune.leopard.in.ua/
# command:
# postgres
# -c max_connections=50
# -c shared_buffers=2GB
# -c effective_cache_size=6GB
# -c maintenance_work_mem=512MB
# -c checkpoint_completion_target=0.9
# -c wal_buffers=16MB
# -c default_statistics_target=100
# -c random_page_cost=1.1
# -c effective_io_concurrency=200
# -c work_mem=20971kB
# -c min_wal_size=1GB
# -c max_wal_size=4GB
# -c max_worker_processes=4
# -c max_parallel_workers_per_gather=2
# -c max_parallel_workers=4
# -c max_parallel_maintenance_workers=2
# Redis ---------------------------------------------------------------------
redis:
image: redis:alpine
pull_policy: always
networks:
- net
restart: unless-stopped
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# Nextcloud -----------------------------------------------------------------
app:
image: nextcloud:${NEXTCLOUD_VERSION}
pull_policy: always
build:
context: nextcloud
args:
NEXTCLOUD_VERSION: ${NEXTCLOUD_VERSION:?NEXTCLOUD_VERSION not set}
no_cache: true
networks:
- net
# - img
restart: unless-stopped
volumes:
- nextcloud_data:/var/www/html
tmpfs:
- /tmp:exec
environment:
NEXTCLOUD_TRUSTED_DOMAINS: ${DOMAIN:?DOMAIN not set}
NEXTCLOUD_ADMIN_USER: ${NEXTCLOUD_ADMIN_USER:?NEXTCLOUD_ADMIN_USER not set}
NEXTCLOUD_ADMIN_PASSWORD: ${NEXTCLOUD_ADMIN_PASSWORD:?NEXTCLOUD_ADMIN_PASSWORD not set}
REDIS_HOST: redis
POSTGRES_HOST: db
POSTGRES_DB: ${POSTGRES_DB:?POSTGRES_DB not set}
POSTGRES_USER: ${POSTGRES_USER:?POSTGRES_USER not set}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD not set}
PHP_MEMORY_LIMIT: ${PHP_MEMORY_LIMIT:?PHP_MEMORY_LIMIT not set}
PHP_UPLOAD_LIMIT: ${PHP_UPLOAD_LIMIT:?PHP_UPLOAD_LIMIT not set}
TZ: 'Europe/Berlin'
env_file:
- nextcloud.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# Cron ----------------------------------------------------------------------
cron:
image: nextcloud:${NEXTCLOUD_VERSION}
build:
context: nextcloud
args:
NEXTCLOUD_VERSION: ${NEXTCLOUD_VERSION:?NEXTCLOUD_VERSION not set}
no_cache: true
networks:
- net
# - img
restart: unless-stopped
volumes_from:
- app
tmpfs:
- /tmp:exec
entrypoint: /cron.sh
environment:
PHP_MEMORY_LIMIT: ${PHP_MEMORY_LIMIT:?PHP_MEMORY_LIMIT not set}
env_file:
- nextcloud.env
depends_on:
db:
condition: service_healthy
app:
condition: service_started
redis:
condition: service_started
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# go-vod ----------------------------------------------------------------------
# go-vod:
# hostname: go-vod
# image: radialapps/go-vod
# restart: unless-stopped
# networks:
# - net
# environment:
# - NEXTCLOUD_HOST=https://${DOMAIN:?DOMAIN not set}
# # - NEXTCLOUD_ALLOW_INSECURE=1 # (self-signed certs or no HTTPS)
# - NVIDIA_VISIBLE_DEVICES=all
# devices:
# - /dev/dri:/dev/dri # VA-API (omit for NVENC)
# volumes:
# - nextcloud_data:/var/www/html:ro
# tmpfs:
# - /tmp:exec
# # runtime: nvidia # (NVENC)
# depends_on:
# app:
# condition: service_started
# logging:
# options:
# max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
# max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}