安装
首先安装Docker和Docker-Compose,安装教程请看Docker文章
创建一个存放docker-compose文件夹并进入
1 2
| mkdir nextcloud cd nextcloud
|
创建docker-compose文件
输入以下内容
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 29 30 31 32 33
| version: '2'
#volumes: # nextcloud: # db:
services: db: image: mysql restart: always command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW volumes: - ./data/db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=Adai1214 - MYSQL_PASSWORD=Adai1214 - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud
app: image: nextcloud restart: always ports: - 8080:80 links: - db volumes: - ./data/nextcloud:/var/www/html environment: - MYSQL_PASSWORD= - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_HOST=db
|
启动部署
1
| sudo docker compose up -d
|
输入本地ip:8080即可访问
如有防火墙开启8080端口
获取WebDav地址
映射到Windows本地请看Windows文章中基础操作映射磁盘