Using this project to deploy Nextcloud service (nginx-fdm-postgres-redis-cron) on your server. The redis and cron are optional, installing them may improve the performance. If you don't want them, just check out the older commit.
You must install docker and docker-compose before using this repo.
git clone https://github.com/ynnie/Nextcloud-Deploy-Docker.gitOpen db.env file and modify POSTGRES_PASSWORD item.
Open and modify .env file.
# Local data directory
DATA_DIR_DB=/XXX/Nextcloud/db # The local directory for database.
DATA_DIR_APP=/XXX/Nextcloud/app # The local directory for Nextcloud.
DATA_DIR_CERT=/XXX/Nextcloud/certs # The local directory for certificates, ignore this if you don't need https.
DATA_DIR_VHOST=/XXX/Nextcloud/vhost.d # The local directory for vhost.d.
DATA_DIR_HTML=/XXX/Nextcloud/html # The local directory for html.
# Host name
HOST_NAME=cloud.xxx.com # Host name, set to you domain name or IP address.**Note: **
You need to create above folders by yourself. If you have a domain and a SSL certificate, you need to setup the HOST_NAME in .env file and put your certificate files in the DATA_DIR_CERT folder. The certificate files should be nginx format and named as your_domain.crt and your_domain.key. If you don't have a domain, you can set HOST_NAME as you server's IP address.
Create and setup docker containers with docker-compose.
docker-compose up -dAt this point, you should be able to access your Nextcloud site with your browser.
使用本项目可以利用docker-compose部署Nextcloud服务(nginx-fdm-postgres-redis-cron)。 其中,redis和cron是可选项目,不配置这两项Nextcloud也可以正常工作,但是配置这两项对性能会有提升。如果你不想配置它们,可以check out之前的commit。
你必须提前将docker和docker-compose安装配置好。本项目不包含相关配置。
git clone https://github.com/ynnie/Nextcloud-Deploy-Docker.gitOpen db.env file and modify POSTGRES_PASSWORD item.
打开db.env文件,将``POSTGRES_PASSWORD 配置为你的希望的数据库密码。
修改 .env 文件:
# Local data directory
DATA_DIR_DB=/XXX/Nextcloud/db # The local directory for database.
DATA_DIR_APP=/XXX/Nextcloud/app # The local directory for Nextcloud.
DATA_DIR_CERT=/XXX/Nextcloud/certs # The local directory for certificates, ignore this if you don't need https.
DATA_DIR_VHOST=/XXX/Nextcloud/vhost.d # The local directory for vhost.d.
DATA_DIR_HTML=/XXX/Nextcloud/html # The local directory for html.
# Host name
HOST_NAME=cloud.xxx.com # Host name, set to you domain name or IP address.**注意: **
在配置好上述目录之后,你需要自行创建这些目录。如果你有自己的域名和SSL证书,将HOST_NAME设置为你的域名地址,然后把证书文件放入DATA_DIR_CERT中。证书必须是nginx格式,并命名为your_domain.crt 和 your_domain.key。如果你没有自己的域名,则可以将HOST_NAME设置为你服务器的IP地址。
利用docker-compose完成docker容器的创建和部署:
docker-compose up -d至此,你应该已经可以通过浏览器访问你的Nextcloud网站了。