0%

安装nextcloud_mysql数据库、数据持久版

1.保存以下为nextcloud.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
version: '2'

volumes:
nextcloud:
db:

services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_PASSWORD=123456
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud

app:
image: nextcloud
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
restart: always

2. apt install docker-compose

3. docker-compose -f nextcloud.yml up -d

4. 打开http://localhost:8081后的数据库配置

1
For the database use db as host and nextcloud as table and user name. Also enter the password you chose in your docker-compose.yml file.

host 用db 就可以了 其他的输入对应的帐号密码。

5.此时使用ip不能访问。

docker exec -it [容器id] base
apt update
apt install vim
vim config/config.php
在trusted_domains下添加 1 => ‘192.168.x.x:8080’
保存即生效。