Next Cloud Install by Docker

前言

NextCloud是基于OwnCloud来进行修改的,因为OwnCloud慢慢地转为商业了,所以开源版本很多bug,但是NextCloud可以继续有开发者支持。bug还继续修复。

配置安装

使用docker-compose来安装

这里有一个别人写好的docker-compose的配置文件
https://hub.docker.com/r/jefferyb/nextcloud/

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
34
35
36
37
38
39
40
41
42
43
44
45
# To run it, do:
# $ docker-compose pull && docker-compose up -d
#
# To upgrade, do:
# $ docker-compose pull && docker-compose stop && docker-compose rm -f && docker-compose up -d
#
# To check the logs, do:
# $ docker-compose logs -f
#

version: '2'

services:
nextcloud:
image: jefferyb/nextcloud
restart: always
container_name: nextcloud-server
links:
- nextcloud-database:mysql
ports:
- 8090:80
volumes:
- ./data/apps:/var/www/html/apps
- ./data/custom_apps:/var/www/html/custom_apps
- ./data/config:/var/www/html/config
- ./data/data:/var/www/html/data
# ENABLE_SSL = true --- certs location
- ./letsencrypt/live/nextcloud.example.com/cert.pem:/etc/ssl/certs/ssl-cert-snakeoil.pem:ro
- ./letsencrypt/live/nextcloud.example.com/privkey.pem:/etc/ssl/private/ssl-cert-snakeoil.key:ro
environment:
- "TZ=Asia/Shanghai"
- "WEB_INSTALL=false"
- "DATABASE_ROOT_PASSWORD=verystrongpassword"
- "EXTERNAL_URL=nextcloud.example.com"
- "ENABLE_SSL=false"

nextcloud-database:
image: mysql/mysql-server
container_name: nextcloud-database
restart: always
volumes:
- ./mysql/runtime:/var/lib/mysql
environment:
- "MYSQL_ROOT_PASSWORD=verystrongpassword"
- "TZ=Asia/Shanghai"

之前那个配置文件有问题,数据库起不来。这个看起来就可以

1
2
3
#run it 
docker-compose pull
docker-compose up -d

参考链接