mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-04-20 04:19:18 +00:00
nextcloud: update readme
This commit is contained in:
parent
9285659f71
commit
22471a0076
@ -2,40 +2,73 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
##### Features
|
#### Features
|
||||||
- Based on **Alpine Linux** (edge).
|
- Based on **Alpine Linux** (edge), with **nginx** and **PHP 7**.
|
||||||
- Image built upon recommendations (sha256 sum + PGP).
|
- Package authenticity check during build process (sha256sum + GPG).
|
||||||
- **Ready to update** : data and apps persistence.
|
- Data and apps persistence (easy to update, just recreate the container).
|
||||||
- **nginx**, **PHP 7**.
|
- OPCache (opcode cache) & APCu (data store) already configured.
|
||||||
- **OPCache** (opcode cache) already configured.
|
- system cron configured (15min periodic), replaces AJAX cron.
|
||||||
- **APCu** (data store) already installed.
|
- MySQL and PostgreSQL support (server not built-in).
|
||||||
- **system cron** already configured.
|
- LDAP support.
|
||||||
- **MySQL/MariaDB/PG-SQL** compatibility (server not built-in).
|
- UID/GID flexibility.
|
||||||
- **UID/GID** flexibility.
|
|
||||||
|
|
||||||
This image is meant to be used behind a secure reverse proxy.
|
This image is meant to be used behind a secure reverse proxy.
|
||||||
|
|
||||||
#### Tags
|
#### Tags
|
||||||
- **latest** : latest stable version.
|
- **latest** : latest stable version.
|
||||||
- **9.0** : latest 9.0.x version.
|
- **9.0** : latest 9.0.x version.
|
||||||
- **daily** : latest code.
|
- **daily** : latest code (daily build).
|
||||||
|
|
||||||
#### Build-time variables
|
#### Build-time variables
|
||||||
- **NEXTCLOUD_VERSION** : version of nextcloud
|
- **NEXTCLOUD_VERSION** : version of nextcloud
|
||||||
- **APCU_VERSION** : version of apcu pecl ext
|
|
||||||
- **APCUBC_VERSION** : version of apcu_bc pecl ext
|
|
||||||
- **GPG_nextcloud** : fingerprint of the signing key
|
- **GPG_nextcloud** : fingerprint of the signing key
|
||||||
|
|
||||||
#### Environment variables
|
#### Environment variables
|
||||||
- **UID** : nextcloud user id *(default : 991)*
|
- **UID** : nextcloud user id *(default : 991)*
|
||||||
- **GID** : nextcloud group id *(default : 991)*
|
- **GID** : nextcloud group id *(default : 991)*
|
||||||
|
|
||||||
#### Volumes
|
#### Port
|
||||||
- **/data** : nextcloud data.
|
- **80**.
|
||||||
- **/config** : configuration files.
|
|
||||||
- **/apps2** : nextcloud downloaded apps.
|
|
||||||
|
|
||||||
Add the following code to your `config.php` in order to enable apps persistence :
|
#### Volumes
|
||||||
|
- **/data** : Nextcloud data.
|
||||||
|
- **/config** : config.php location.
|
||||||
|
- **/apps2** : Nextcloud downloaded apps.
|
||||||
|
|
||||||
|
#### Database (external container)
|
||||||
|
You have to use an **external** database container. I suggest you to use **MariaDB**, which is a reliable database server. You can use the official `mariadb` image available on Docker Hub to create a database container, which must be linked to the Nextcloud container.
|
||||||
|
|
||||||
|
#### Setup
|
||||||
|
Pull the image and create a container. `/mnt` can be **anywhere on your host**. Change MYSQL_ROOT_PASSWORD and MYSQL_PASSWORD values (mariadb). You may also want to change UID and GID (nextcloud).
|
||||||
|
|
||||||
|
````
|
||||||
|
docker pull wonderfall/nextcloud && docker pull mariadb:10
|
||||||
|
docker run -d --name db_nextcloud -v /mnt/nextcloud/db:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=supersecretpassword -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=supersecretpassword mariadb:10
|
||||||
|
docker run -d --name nextcloud --link db_nextcloud:db_nextcloud -e UID=1000 -e GID=1000 -v /mnt/nextcloud/data:/data -v /mnt/nextcloud/config:/config -v /mnt/nextcloud/apps:/apps2 wonderfall/nextcloud
|
||||||
|
```
|
||||||
|
|
||||||
|
**Below you can find a docker-compose file, which is very useful !**
|
||||||
|
|
||||||
|
Now you have to use a reverse proxy in order to access to your container through Internet, details on it are available at the end of the README.md.
|
||||||
|
|
||||||
|
Browse to Nextcloud setup page, then :
|
||||||
|
- **Data folder** : change `/nextcloud/data` to `/data`.
|
||||||
|
- **Database** : fill in all the fields to configure your database.
|
||||||
|
- user : MYSQL_USER.
|
||||||
|
- password : MYSQL_PASSWORD.
|
||||||
|
- name : MYSQL_DATABASE.
|
||||||
|
- host : name of the mariadb container.
|
||||||
|
- **Don't forget** : use strong passwords, choose another name for the admin account.
|
||||||
|
|
||||||
|
#### Configure
|
||||||
|
In the admin panel, you should switch from `AJAX cron` to `cron` (system cron).
|
||||||
|
To **enable APCU**, add this line to your config.php :
|
||||||
|
|
||||||
|
```
|
||||||
|
'memcache.local' => '\OC\Memcache\APCu',
|
||||||
|
```
|
||||||
|
|
||||||
|
Add the following lines to your `config.php` in order to enable apps persistence :
|
||||||
|
|
||||||
```
|
```
|
||||||
"apps_paths" => array (
|
"apps_paths" => array (
|
||||||
@ -52,27 +85,23 @@ Add the following code to your `config.php` in order to enable apps persistence
|
|||||||
),
|
),
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Database
|
**Note :** The container must be restarted after any change to `/config/config.php`.
|
||||||
You have to use an external database container. I suggest you to use MariaDB, which is a reliable database server. For example, you can use the official `mariadb` image available as an automated build that you can find on Docker Hub. Since sqlite is supected by Nextcloud to cause some troubles with sync clients, sqlite databases are not suported as they shouldn't be used.
|
|
||||||
|
|
||||||
#### Setup
|
#### Update
|
||||||
Go to your fresh Nextcloud instance, change `/nextcloud/data` to `/data` (recommended), and fill in all the fields to configure your database. Don't forget to provide with a strong password. You should choose another name for the administration account (not 'admin' which is the default one). The database host is the name of the database container, which is linked to the nexcloud container. You can see below an example of docker-compose.
|
Pull a newer image, then recreate the container :
|
||||||
|
|
||||||
#### Configure
|
|
||||||
`/config` should contain `config.php`, though this is not the file actually used by Nextcloud. Each time you restart the container, `/config/config.php` overwrites `/nextcloud/config/config.php`. Before that, `/nextcloud/config/config.php` is copied as `/nextcloud/config/config.php.bkp`, so you can easily revert changes.
|
|
||||||
|
|
||||||
In the admin pannel, you should switch from `AJAX cron` to `cron` (system cron). By the way, **I highly recommend encryption**! Why not?
|
|
||||||
|
|
||||||
To **enable APCU**, add this line to your config.php :
|
|
||||||
|
|
||||||
```
|
```
|
||||||
'memcache.local' => '\OC\Memcache\APCu',
|
docker pull wonderfall/nextcloud
|
||||||
|
docker rm nextcloud
|
||||||
|
docker run -d --name nextcloud --link db_nextcloud:db_nextcloud -e UID=1000 -e GID=1000 -v /mnt/nextcloud/data:/data -v /mnt/nextcloud/config:/config -v /mnt/nextcloud/apps:/apps2 wonderfall/nextcloud
|
||||||
```
|
```
|
||||||
|
|
||||||
#### How do I update?
|
If Nextcloud performed a full upgrade, your apps could be disabled. Enable them again.
|
||||||
Just pull the newer image, and recreate the container.
|
|
||||||
|
#### Docker-compose
|
||||||
|
|
||||||
|
I advise you to use [docker-compose](https://docs.docker.com/compose/), which is a great tool for managing containers. You can create a `docker-compose.yml` with the following content (which must be adapted to your needs) and then run everything with `docker-compose up -d`, that's it!
|
||||||
|
|
||||||
#### Docker Compose (example)
|
|
||||||
```
|
```
|
||||||
nextcloud:
|
nextcloud:
|
||||||
image: wonderfall/nextcloud
|
image: wonderfall/nextcloud
|
||||||
@ -96,11 +125,12 @@ db_nextcloud:
|
|||||||
- MYSQL_USER=nextcloud
|
- MYSQL_USER=nextcloud
|
||||||
- MYSQL_PASSWORD=supersecretpassword
|
- MYSQL_PASSWORD=supersecretpassword
|
||||||
```
|
```
|
||||||
|
You can update everything with `docker-compose pull` followed by `docker-compose up -d`.
|
||||||
#### Port
|
|
||||||
- **80**.
|
|
||||||
|
|
||||||
#### Reverse proxy
|
#### Reverse proxy
|
||||||
https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration
|
You should be familiar with reverse proxying, otherwise you should read some documentation about it. If you're using nginx, there are two possibilites :
|
||||||
|
- nginx is on the host : use the IP address you can get with `docker inspect nextcloud | grep IPAddress\" | head -n1 | grep -Eo "[0-9.]+" `. But whenever the container is restarted or recreated, its IP address can change.
|
||||||
|
|
||||||
Headers are already sent by the container. It is strongly recommended to use Nextcloud through an encrypted connection (HTTPS).
|
- nginx is in a container, things are easier : https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration (example). If you don't get it : **nextcloud is linked to nginx** (containers) so you can use `proxy_pass http://nextcloud`. Very easy. I suggest you to use my image `wonderfall/nginx`, which provides a tool named `ngxproxy` aiming at automatically create a vhost file. You will be asked a few questions.
|
||||||
|
|
||||||
|
Headers are already sent by the container, including HSTS, so no need to add them again. **It is strongly recommended to use Nextcloud through an encrypted connection (HTTPS).** [Let's Encrypt](https://letsencrypt.org/) provides free SSL/TLS certificates (trustworthy!).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user