🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
使用docker部署 下载docker-compose文件 ``` mkdir owncloud-docker-server cd owncloud-docker-server/ wget https://raw.githubusercontent.com/owncloud-docker/server/master/docker-compose.yml ``` 写入环境变量文件 ``` cat << EOF > .env OWNCLOUD_VERSION=10.0 OWNCLOUD_DOMAIN=localhost ADMIN_USERNAME=admin ADMIN_PASSWORD=admin HTTP_PORT=80 HTTPS_PORT=443 EOF ``` 修改compose文件,主要修改挂载目录 ``` [root@could-100 owncloud-docker-server]# cat docker-compose.yml version: '2.1' #volumes: # #files: # mysql: # driver: local # backup: # driver: local # redis: # driver: local services: owncloud: image: owncloud/server:${OWNCLOUD_VERSION} restart: always ports: - ${HTTPS_PORT}:443 - ${HTTP_PORT}:80 depends_on: - db - redis environment: - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN} - OWNCLOUD_DB_TYPE=mysql - OWNCLOUD_DB_NAME=owncloud - OWNCLOUD_DB_USERNAME=owncloud - OWNCLOUD_DB_PASSWORD=owncloud - OWNCLOUD_DB_HOST=db - OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME} - OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD} - OWNCLOUD_UTF8MB4_ENABLED=true - OWNCLOUD_REDIS_ENABLED=true - OWNCLOUD_REDIS_HOST=redis healthcheck: test: ["CMD", "/usr/bin/healthcheck"] interval: 30s timeout: 10s retries: 5 volumes: - /data/share:/mnt/data db: image: webhippie/mariadb:latest restart: always environment: - MARIADB_ROOT_PASSWORD=owncloud - MARIADB_USERNAME=owncloud - MARIADB_PASSWORD=owncloud - MARIADB_DATABASE=owncloud - MARIADB_MAX_ALLOWED_PACKET=128M - MARIADB_INNODB_LOG_FILE_SIZE=64M - MARIADB_INNODB_LARGE_PREFIX=ON - MARIADB_INNODB_FILE_FORMAT=Barracuda healthcheck: test: ["CMD", "/usr/bin/healthcheck"] interval: 30s timeout: 10s retries: 5 volumes: - /data/own_mysql:/var/lib/mysql - /data/own_backup:/var/lib/backup redis: image: webhippie/redis:latest restart: always environment: - REDIS_DATABASES=1 healthcheck: test: ["CMD", "/usr/bin/healthcheck"] interval: 30s timeout: 10s retries: 5 volumes: - /data/own_redis:/var/lib/redis ``` 启动命令 ``` docker-compose up -d ``` 其他机器通过命令行连接webdav上传 ``` apt-get install davfs2 mount -t davfs http://192.168.86.45/remote.php/dav/files/zhangya/ /mnt ``` webdav地址在登录页面的左下角 ![](https://box.kancloud.cn/604de99300d8a02d46f1f7c30f678aed_269x191.png)