102 lines
3.6 KiB
Markdown
Raw Normal View History

2016-06-16 12:54:04 +02:00
## wonderfall/nextcloud
2016-06-16 12:55:43 +02:00
![](https://pix.schrodinger.io/lwq5gNX5/mSPk3B7c.png)
2016-06-16 12:54:04 +02:00
#### Features
- Based on **Alpine Linux** (edge).
2016-06-16 17:03:55 +02:00
- Image built upon recommendations (sha256 sum + PGP).
2016-06-16 12:54:04 +02:00
- **Ready to update** : data and apps persistence.
2016-06-16 17:03:55 +02:00
- **nginx**, **PHP 7**.
- **OPCache** (opcode cache) already configured.
- **APCu** (data store) already installed.
- **system cron** already configured.
2016-06-16 12:54:04 +02:00
- **MySQL/MariaDB** compatibility (server not built-in).
2016-06-16 17:03:55 +02:00
- **UID/GID** flexibility.
2016-06-16 12:54:04 +02:00
2016-06-16 17:03:55 +02:00
This image is meant to be used behind a secure reverse proxy.
2016-06-16 12:54:04 +02:00
#### Build-time variables
- **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
#### Environment variables
- **UID** : nextcloud user id *(default : 991)*
- **GID** : nextcloud group id *(default : 991)*
#### Volumes
2016-06-16 17:03:55 +02:00
- **/data** : nextcloud data.
- **/config** : configuration files.
- **/apps2** : nextcloud downloaded apps.
2016-06-16 12:54:04 +02:00
2016-06-16 17:03:55 +02:00
Add the following code to your `config.php` in order to enable apps persistence :
2016-06-16 12:54:04 +02:00
```
"apps_paths" => array (
0 => array (
"path" => "/nextcloud/apps",
"url" => "/apps",
"writable" => false,
),
1 => array (
"path" => "/apps2",
"url" => "/apps2",
"writable" => true,
),
),
```
2016-06-16 17:03:55 +02:00
#### Database
2016-06-16 20:29:30 +02:00
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.
2016-06-16 12:54:04 +02:00
2016-06-16 17:03:55 +02:00
#### Setup
2016-06-16 20:29:30 +02:00
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.
2016-06-16 12:54:04 +02:00
#### Configure
2016-06-16 17:03:55 +02:00
`/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.
2016-06-16 12:54:04 +02:00
2016-06-16 17:03:55 +02:00
In the admin pannel, you should switch from `AJAX cron` to `cron` (system cron). By the way, **I highly recommend encryption**! Why not?
2016-06-16 12:54:04 +02:00
2016-06-16 17:03:55 +02:00
To **enable APCU**, add this line to your config.php :
2016-06-16 12:54:04 +02:00
```
'memcache.local' => '\OC\Memcache\APCu',
```
2016-06-16 17:03:55 +02:00
#### How do I update?
Just pull the newer image, and recreate the container.
2016-06-16 12:54:04 +02:00
#### Docker Compose (example)
```
nextcloud:
2016-06-16 13:10:02 +02:00
image: wonderfall/nextcloud
2016-06-16 12:54:04 +02:00
links:
- db_nextcloud:db_nextcloud
environment:
- UID=1000
- GID=1000
volumes:
- /mnt/nextcloud/data:/data
- /mnt/nextcloud/config:/config
- /mnt/nextcloud/apps:/apps2
db_nextcloud:
image: mariadb:10
volumes:
- /mnt/nextcloud/db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=supersecretpassword
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=supersecretpassword
```
#### Port
2016-06-16 17:03:55 +02:00
- **80**.
2016-06-16 12:54:04 +02:00
#### Reverse proxy
https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration
2016-06-16 17:03:55 +02:00
Headers are already sent by the container. It is strongly recommended to use Nextcloud through an encrypted connection (HTTPS).