2022-08-25 22:22:11 +02:00
version: '3.3'
services:
######## Datenbank ########
nextcloud-db:
2023-03-24 14:19:43 +01:00
image: mariadb:10
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:
2023-10-31 11:37:50 +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
labels:
2023-04-20 14:50:33 +02:00
com.centurylinklabs.watchtower.enable: true
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:
2023-03-24 14:19:43 +01:00
image: redis:7-alpine
2022-08-25 22:22:11 +02:00
container_name: nextcloud-redis
hostname: nextcloud-redis
networks:
- intern
restart: unless-stopped
2023-10-31 11:37:50 +01:00
command: redis-server --requirepass {{ lookup('keepass', 'nextcloud_redis_host_password', 'password') }}
2022-08-25 22:22:11 +02:00
labels:
2023-04-20 14:50:33 +02:00
com.centurylinklabs.watchtower.enable: true
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
2023-10-31 18:46:23 +01:00
image: registry.mgrote.net/nextcloud-cronjob:master
2022-08-25 22:22:11 +02:00
restart: unless-stopped
network_mode: none
depends_on:
2023-11-10 11:50:08 +01:00
- nextcloud-app
2022-08-25 22:22:11 +02:00
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
labels:
2023-04-20 14:50:33 +02:00
com.centurylinklabs.watchtower.enable: true
2023-03-21 19:00:37 +01:00
2022-08-25 22:22:11 +02:00
######## Nextcloud ########
nextcloud-app:
2023-10-31 11:37:50 +01:00
image: nextcloud:27
2022-08-25 22:22:11 +02:00
container_name: nextcloud-app
restart: unless-stopped
depends_on:
- nextcloud-db
- nextcloud-redis
environment:
REDIS_HOST: nextcloud-redis
2023-10-31 11:37:50 +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
2023-10-31 11:37:50 +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
2023-10-31 11:37:50 +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
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
2022-08-25 22:22:11 +02:00
labels:
2023-04-20 14:50:33 +02:00
com.centurylinklabs.watchtower.enable: true
com.centurylinklabs.watchtower.depends-on: nextcloud-redis,nextcloud-db
2023-03-21 19:00:37 +01:00
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"