Nextcloud是一款开源免费的私有云存储网盘项目,可以让你快速便捷地搭建一套属于自己或团队的云同步网盘,从而实现跨平台跨设备文件同步、共享、版本控制、团队协作等功能。它的客户端覆盖了Windows、Mac、Android、iOS、Linux 等各种平台,也提供了网页端以及 WebDAV接口,所以你几乎可以在各种设备上方便地访问你的云盘。
Nextcloud 安装方式很多,这里选择了docker
基础搭建 创建 docker-compose.yml
# 可以选择 nextcloud与db 分开
version: "3.6"
services:
nextcloud:
image: nextcloud:19.0.1
restart: always
expose:
- 80
#volumes:
# Linux 环境下使用
# - /etc/localtime:/etc/localtime:ro
# - /etc/timezone:/etc/timezone:ro
#- ./data:/var/www/html/data:rw
#- ./config.php:/var/www/html/config/config.php:rw
extra_hosts:
- "nextcloud-halobug.local.cn:127.0.0.1"
networks:
- traefik
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.halobug-main.entrypoints=http"
- "traefik.http.routers.halobug-main.rule=Host(`nextcloud-halobug.local.cn`)"
- "traefik.http.services.halobug-main-backend.loadbalancer.server.scheme=http"
- "traefik.http.services.halobug-main-backend.loadbalancer.server.port=80"
# healthcheck:
# test: ["CMD-SHELL", "curl -f localhost/status.php || exit 1"]
# interval: 5s
# retries: 12
logging:
driver: "json-file"
options:
max-size: "1m"
db:
image: mariadb
container_name: database
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=nextcloud
- MYSQL_PASSWORD=nextcloud
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
networks:
- traefik
#healthcheck:
## test: mysqladmin ping -h localhost -p$MYSQL_ROOT_PASSWORD && test '0' -eq $(ps aux | awk '{print $11}' | grep -c -e '^mysql$')
# interval: 5s
# retries: 12
networks:
traefik:
external: true
docker-compose up 后,访问不出意外能看到下面截图
数据库这里选择mysql 输入后 会看到安装进度
如果你在安装界面勾选了安装办公应用将能够看到应用安装界面。
一切就绪之后,会看到欢迎界面。