Docker 安装 Nextcloud
1.docker compose 文件
version: '3'
services:
db:
image: mariadb:10.6
restart: always
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- /mnt/docker/mariadb/conf:/etc/mysql/conf.d
- /mnt/docker/mariadb/logs:/logs
- /mnt/docker/mariadb/data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=qwer1234
- MYSQL_PASSWORD=qwer1234
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=fanqi
- TZ=Asia/Shanghai
app:
image: nextcloud
restart: always
ports:
- 8777:80
links:
- db
volumes:
- /mnt/docker/nextcloud/html:/var/www/html
- /mnt/docker/nextcloud/html/custom_apps:/var/www/html/custom_apps
- /mnt/docker/nextcloud/html/config:/var/www/html/config
- /mnt/docker/nextcloud/html/data:/var/www/html/data
environment:
- MYSQL_PASSWORD=qwer1234
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=fanqi
- MYSQL_HOST=db
- NEXTCLOUD_ADMIN_USER=fanqi
- NEXTCLOUD_ADMIN_PASSWORD=qwer1234
2.启动
docker compose up -d
3.关于初始化过程中无法在数据库中还原表的报错问题
注册错误提示:nextcloud install Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
1.进入数据库中的docker容器
docker exec -it containerId /bin/bash
2.登录数据库
mysql -u root -p
#输入密码登录
3.输入以下命令并回车
SET GLOBAL innodb_read_only_compressed=OFF;