2022-08-25 22:22:11 +02:00
version: '3.3'
services:
######## Datenbank ########
nextcloud-db:
2024-02-21 08:35:07 +01:00
image: "mariadb:11.3.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-01-26 22:37:25 +01:00
MYSQL_ROOT_PASSWORD: "{{ lookup('keepass', 'nextcloud_mysql_root_password', 'password') }}"
MYSQL_PASSWORD: "{{ lookup('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",
"--connect",
]
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-02-06 20:46:14 +01:00
image: "redis:7.2.4"
2022-08-25 22:22:11 +02:00
container_name: nextcloud-redis
hostname: nextcloud-redis
networks:
- intern
restart: unless-stopped
2024-01-26 22:37:25 +01:00
command: "redis-server --requirepass {{ lookup('keepass', 'nextcloud_redis_host_password', 'password') }}"
2024-02-02 13:52:33 +01:00
healthcheck:
test: ["CMD", "redis-cli", "--pass", "{{ lookup('keepass', 'nextcloud_redis_host_password', 'password') }}", "--no-auth-warning", "ping"]
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-24 02:46:17 +02:00
image: "registry.mgrote.net/nextcloud-cronjob:v1.1.97"
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-03-30 00:38:43 +01:00
image: "nextcloud:28.0.4"
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:
REDIS_HOST: nextcloud-redis
2024-01-26 22:37:25 +01:00
REDIS_HOST_PASSWORD: "{{ lookup('keepass', 'nextcloud_redis_host_password', 'password') }}"
2022-08-25 22:22:11 +02:00
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
2024-01-26 22:37:25 +01:00
MYSQL_PASSWORD: "{{ lookup('keepass', 'nextcloud_mysql_password', 'password') }}"
2022-08-25 22:22:11 +02:00
MYSQL_HOST: nextcloud-db
NEXTCLOUD_TRUSTED_DOMAINS: "nextcloud.mgrote.net"
2023-10-31 11:37:50 +01:00
SMTP_HOST: mail-relay
#SMTP_SECURE: tls
SMTP_PORT: 25
#SMTP_AUTHTYPE: LOGIN
2022-08-25 22:22:11 +02:00
SMTP_NAME: info@mgrote.net
2024-01-26 22:37:25 +01:00
#SMTP_PASSWORD: "{{ lookup('keepass', 'strato_smtp_password', 'password') }}"
2022-08-25 22:22:11 +02:00
MAIL_FROM_ADDRESS: info@mgrote.net
PHP_MEMORY_LIMIT: 1024M
PHP_UPLOAD_LIMIT: 10G
APACHE_DISABLE_REWRITE_IP: 1
2023-05-12 08:18:45 +02:00
TRUSTED_PROXIES: "192.168.48.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
networks:
- intern
- traefik
2023-10-31 11:37:50 +01:00
- mail-relay
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
2023-10-31 11:37:50 +01:00
mail-relay:
external: true
2022-08-25 22:22:11 +02:00
######## Volumes ########
volumes:
db:
app:
data:
######## Doku ########
# Telefonregion
# docker exec --user www-data nextcloud-app php occ config:system:set default_phone_region --value="DE"
2023-12-20 12:30:22 +01:00
# https://help.nextcloud.com/t/nextcloud-wont-load-any-mixed-content/13565/3
# docker exec --user www-data nextcloud-app php occ config:system:set overwriteprotocol --value="https"
# docker exec --user www-data nextcloud-app php occ config:system:set overwrite.cli.url --value="http://nextcloud.mgrote.net"