2022-08-25 22:22:11 +02:00
services:
######## Datenbank ########
nextcloud-db:
2024-08-22 22:53:05 +02:00
image: "mariadb:11.5.2"
2022-08-25 22:22:11 +02:00
container_name: nextcloud-db
command: --transaction-isolation=READ-COMMITTED --log-bin=ROW --innodb_read_only_compressed=OFF
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- db:/var/lib/mysql
environment:
2024-07-09 17:35:56 +02:00
MYSQL_ROOT_PASSWORD: "{{ lookup('viczem.keepass.keepass', 'nextcloud_mysql_root_password', 'password') }}"
MYSQL_PASSWORD: "{{ lookup('viczem.keepass.keepass', 'nextcloud_mysql_password', 'password') }}"
2023-04-06 19:53:27 +02:00
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_INITDB_SKIP_TZINFO: 1
2022-08-25 22:22:11 +02:00
networks:
- intern
2024-02-02 13:52:33 +01:00
healthcheck:
interval: 30s
retries: 3
test:
[
"CMD",
"healthcheck.sh",
2024-05-07 01:38:04 +02:00
"--su-mysql",
"--connect"
2024-02-02 13:52:33 +01:00
]
timeout: 30s
2023-03-21 19:00:37 +01:00
2023-12-20 12:33:07 +01:00
# Error
## [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).
## [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').
# Fix
## docker exec nextcloud-db mysql nextcloud -p<MySQL-Root-Pw> -e "ALTER TABLE mysql.column_stats MODIFY histogram longblob;"
## docker exec nextcloud-db mysql nextcloud -p<MySQL-Root-Pw> -e "ALTER TABLE mysql.column_stats MODIFY hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB');"
2022-08-25 22:22:11 +02:00
######## Redis ########
nextcloud-redis:
2024-07-30 10:07:09 +02:00
image: "redis:7.4.0"
2022-08-25 22:22:11 +02:00
container_name: nextcloud-redis
hostname: nextcloud-redis
networks:
- intern
restart: unless-stopped
2024-07-09 17:35:56 +02:00
command: "redis-server --requirepass {{ lookup('viczem.keepass.keepass', 'nextcloud_redis_host_password', 'password') }}"
2024-02-02 13:52:33 +01:00
healthcheck:
2024-07-09 17:35:56 +02:00
test: ["CMD", "redis-cli", "--pass", "{{ lookup('viczem.keepass.keepass', 'nextcloud_redis_host_password', 'password') }}", "--no-auth-warning", "ping"]
2024-02-02 13:52:33 +01:00
interval: 5s
timeout: 2s
retries: 3
2023-03-21 19:00:37 +01:00
2022-08-25 22:22:11 +02:00
######## cron ########
2023-04-20 21:10:10 +02:00
nextcloud-cron:
2022-08-25 22:22:11 +02:00
container_name: nextcloud-cron
2024-04-30 09:25:04 +02:00
image: "registry.mgrote.net/nextcloud-cronjob:latest"
2022-08-25 22:22:11 +02:00
restart: unless-stopped
network_mode: none
volumes:
2023-11-10 11:50:08 +01:00
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/localtime:/etc/localtime:ro
2022-08-25 22:22:11 +02:00
environment:
2023-04-06 19:53:27 +02:00
NEXTCLOUD_CONTAINER_NAME: nextcloud-app
NEXTCLOUD_CRON_MINUTE_INTERVAL: 1
2023-03-21 19:00:37 +01:00
2022-08-25 22:22:11 +02:00
######## Nextcloud ########
nextcloud-app:
2024-09-23 15:25:38 +02:00
image: "nextcloud:30.0.0"
2022-08-25 22:22:11 +02:00
container_name: nextcloud-app
restart: unless-stopped
depends_on:
- nextcloud-db
- nextcloud-redis
2024-03-20 09:34:58 +01:00
- nextcloud-cron
2022-08-25 22:22:11 +02:00
environment:
2024-06-03 21:23:53 +02:00
# redis
2022-08-25 22:22:11 +02:00
REDIS_HOST: nextcloud-redis
2024-07-09 17:35:56 +02:00
REDIS_HOST_PASSWORD: "{{ lookup('viczem.keepass.keepass', 'nextcloud_redis_host_password', 'password') }}"
2024-06-03 21:23:53 +02:00
# mysql
2022-08-25 22:22:11 +02:00
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
2024-07-09 17:35:56 +02:00
MYSQL_PASSWORD: "{{ lookup('viczem.keepass.keepass', 'nextcloud_mysql_password', 'password') }}"
2022-08-25 22:22:11 +02:00
MYSQL_HOST: nextcloud-db
2024-06-03 21:23:53 +02:00
# admin
NEXTCLOUD_ADMIN_USER: n-admin
2024-07-09 17:35:56 +02:00
NEXTCLOUD_ADMIN_PASSWORD: "{{ lookup('viczem.keepass.keepass', 'nextcloud_admin_user_password', 'password') }}"
2024-06-03 21:23:53 +02:00
# misc
2022-08-25 22:22:11 +02:00
NEXTCLOUD_TRUSTED_DOMAINS: "nextcloud.mgrote.net"
PHP_MEMORY_LIMIT: 1024M
PHP_UPLOAD_LIMIT: 10G
APACHE_DISABLE_REWRITE_IP: 1
2024-06-03 21:23:53 +02:00
TRUSTED_PROXIES: "172.18.0.0/24" # Subnetz in dem sich traefik befindet
2024-04-23 09:34:32 +02:00
NEXTCLOUD_UPLOAD_LIMIT: 10G
2024-04-23 09:43:07 +02:00
NEXTCLOUD_MAX_TIME: 3600
APACHE_BODY_LIMIT: 0 # unlimited, https://github.com/nextcloud/docker/issues/1796
2022-08-25 22:22:11 +02:00
volumes:
- app:/var/www/html
- data:/var/www/html/data
2024-06-03 21:23:53 +02:00
# hook-script nach install welches die ldap-config setzt, je einmal nach install und vor starten
- ./ldap.sh:/docker-entrypoint-hooks.d/post-installation/ldap.sh
- ./ldap.sh:/docker-entrypoint-hooks.d/before-starting/ldap.sh
# weitere scripte
- ./misc.sh:/docker-entrypoint-hooks.d/post-installation/misc.sh
- ./misc.sh:/docker-entrypoint-hooks.d/before-starting/misc.sh
2022-08-25 22:22:11 +02:00
networks:
- intern
- traefik
2024-07-30 23:05:24 +02:00
- postfix
2024-02-02 13:52:33 +01:00
healthcheck:
test: ["CMD", "curl", "-f", "--insecure", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
2022-08-25 22:22:11 +02:00
labels:
2023-04-20 14:50:33 +02:00
traefik.http.routers.nextcloud.rule: Host(`nextcloud.mgrote.net`)
traefik.enable: true
traefik.http.routers.nextcloud.tls: true
traefik.http.routers.nextcloud.tls.certresolver: resolver_letsencrypt
traefik.http.routers.nextcloud.entrypoints: entry_https
traefik.http.services.nextcloud.loadbalancer.server.port: 80
2022-08-25 22:22:11 +02:00
2023-04-20 14:50:33 +02:00
traefik.http.middlewares.nextcloud-webdav.replacepathregex.regex: "^/.well-known/ca(l|rd)dav"
traefik.http.middlewares.nextcloud-webdav.replacepathregex.replacement: "/remote.php/dav/"
2022-08-25 22:22:11 +02:00
2023-04-20 14:50:33 +02:00
traefik.http.middlewares.nextcloud-hsts.headers.stsincludesubdomains: false
traefik.http.middlewares.nextcloud-hsts.headers.stspreload: true
traefik.http.middlewares.nextcloud-hsts.headers.stsseconds: 15552001
traefik.http.middlewares.nextcloud-hsts.headers.isdevelopment: false
2022-08-25 22:22:11 +02:00
2023-04-21 11:53:59 +02:00
traefik.http.routers.nextcloud.middlewares: nextcloud-hsts,nextcloud-webdav
2022-08-25 22:22:11 +02:00
######## Networks ########
networks:
intern:
driver: bridge
traefik:
external: true
2024-07-30 23:05:24 +02:00
postfix:
2023-10-31 11:37:50 +01:00
external: true
2022-08-25 22:22:11 +02:00
######## Volumes ########
volumes:
db:
app:
data: