0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2024-12-25 18:46:14 +01:00
nextcloud-docker/.examples/README.md

110 lines
6.7 KiB
Markdown
Raw Normal View History

2017-08-16 18:01:14 +02:00
# Examples section
In this subfolders are some examples how to use the docker image. There are two sections:
2018-08-01 22:55:25 +02:00
2017-08-16 18:01:14 +02:00
* [`dockerfiles`](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles)
2017-08-16 18:05:22 +02:00
* [`docker-compose`](https://github.com/nextcloud/docker/tree/master/.examples/docker-compose)
2017-08-16 18:01:14 +02:00
The `dockerfiles` are derived images, that add or alter certain functionalities of the default docker images. In the `docker-compose` subfolder are examples for deployment of the application, including database, redis, collabora and other services.
## Dockerfiles
2017-08-16 18:05:22 +02:00
The Dockerfiles use the default images as base image and build on top of it.
2017-08-16 18:01:14 +02:00
Example | Description
------- | -------
2018-10-16 16:38:36 +02:00
[cron](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed). This image runs `supervisord` to start nextcloud and cron as two seperate processes inside the container.
2017-08-16 18:34:01 +02:00
[imap](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/imap) | adds dependencies required to authenticate users via imap
[smb](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/smb) | adds dependencies required to use smb shares
2017-12-24 14:47:05 +01:00
[full](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/full) | adds dependencies for ALL optional packages and cron functionality via supervisor (as in the `cron` example Dockerfile).
2017-08-16 18:01:14 +02:00
2017-12-24 14:47:05 +01:00
### full
The `full` Dockerfile example adds dependencies for all optional packages suggested by nextcloud that may be needed for some features (e.g. Video Preview Generation), as stated in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html).
2017-08-16 18:01:14 +02:00
NOTE: The Dockerfile does not install the LibreOffice package (line is commented), because it would increase the generated Image size by approximately 500 MB. In order to install it, simply uncomment the appropriate line in the Dockerfile.
2018-01-04 18:11:21 +01:00
NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, and XBitmap Files are generated. The configuration of the preview generation can be done in config.php, as explained in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#previews)
2018-01-04 18:11:21 +01:00
NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors.
2017-12-24 14:47:05 +01:00
The required steps for each optional/recommended package that is not already in the Nextcloud image are listed here, so that the Dockerfile can easily be modified to only install the needed extra packages. Simply remove the steps for the unwanted packages from the Dockerfile.
2017-12-24 14:47:05 +01:00
#### PHP Module bz2
`docker-php-ext-install bz2`
2017-12-24 14:47:05 +01:00
#### PHP Module imap
`apt install libc-client-dev libkrb5-dev`
`docker-php-ext-configure imap --with-kerberos --with-imap-ssl`
`docker-php-ext-install imap`
2017-12-24 14:47:05 +01:00
#### PHP Module gmp
`apt install libgmp3-dev`
`docker-php-ext-install gmp`
2017-12-24 14:47:05 +01:00
#### PHP Module smbclient
`apt install smbclient libsmbclient-dev`
`pecl install smbclient`
`docker-php-ext-enable smbclient`
2017-12-24 14:47:05 +01:00
#### ffmpeg
`apt install ffmpeg`
2017-12-24 14:47:05 +01:00
#### imagemagick SVG support
`apt install libmagickcore-6.q16-3-extra`
2017-12-24 14:47:05 +01:00
#### LibreOffice
`apt install libreoffice`
2017-12-24 14:47:05 +01:00
#### CRON via supervisor
`apt install supervisor`
`mkdir /var/log/supervisord /var/run/supervisord`
The following Dockerfile commands are also necessary for a sucessfull cron installation:
`COPY supervisord.conf /etc/supervisor/supervisord.conf`
`CMD ["/usr/bin/supervisord"]`
2017-08-16 18:01:14 +02:00
## docker-compose
2017-08-16 18:05:22 +02:00
In `docker-compose` additional services are bundled to create a complete nextcloud installation. The examples are designed to run out-of-the-box.
2017-08-16 18:37:32 +02:00
Before running the examples you have to modify the `db.env` and `docker-compose.yml` file and fill in your custom information.
2017-08-16 18:01:14 +02:00
2017-08-16 23:24:14 +02:00
The docker-compose examples make heavily use of dereived Dockerfiles to add configuration files into the containers. This way they should also work on remote docker systems as _Docker for Windows_. When running docker-compose on the same host as the docker daemon, another possibility would be to simply mount the files in the volumes section in the `docker-compose.yml` file.
2017-08-16 18:01:14 +02:00
2017-09-24 14:36:51 +02:00
### insecure
This example should only be used for testing on the local network because it uses a unencrypted http connection.
When you want to have your server reachable from the internet adding HTTPS-encryption is mandatory!
For this use one of the [with-nginx-proxy](#with-nginx-proxy) examples.
2017-09-24 14:36:51 +02:00
To use this example complete the following steps:
1. if you use mariadb or mysql choose a root password for the database in `docker-compose.yml` behind `MYSQL_ROOT_PASSWORD=`
2. choose a password for the database user nextcloud in `db.env` behind `MYSQL_PASSWORD=` (for mariadb/mysql) or `POSTGRES_PASSWORD=` (for postgres)
3. run `docker-compose build --pull` to pull the most recent base images and build the custom dockerfiles
4. start nextcloud with `docker-compose up -d`
If you want to update your installation to a newer version of nextcloud, repeat the steps 3 and 4.
2017-08-16 18:01:14 +02:00
### with-nginx-proxy
The nginx proxy adds a proxy layer between nextcloud and the internet. The proxy is designed to serve multiple sites on the same host machine.
2018-08-05 11:25:47 +02:00
2017-08-16 18:05:22 +02:00
The advantage in adding this layer is the ability to add a container for [Let's Encrypt](https://letsencrypt.org/) certificate handling.
2018-05-11 12:46:39 +02:00
This combination of the [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) and [jrcs/docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) containers creates a fully automated https encryption of the nextcloud installation without worrying about certificate generation, validation or renewal.
**This setup only works with a valid domain name on a server that is reachable from the internet.**
2017-08-16 18:01:14 +02:00
To use this example complete the following steps:
2017-08-16 23:24:14 +02:00
1. open `docker-compose.yml`
2017-08-16 18:07:16 +02:00
1. insert your nextcloud domain behind `VIRTUAL_HOST=`and `LETSENCRYPT_HOST=`
2017-08-16 23:24:14 +02:00
2. enter a valid email behind `LETSENCRYPT_EMAIL=`
2017-09-24 14:36:51 +02:00
3. if you use mariadb or mysql choose a root password for the database behind `MYSQL_ROOT_PASSWORD=`
2. choose a password for the database user nextcloud in `db.env` behind `MYSQL_PASSWORD=` (for mariadb/mysql) or `POSTGRES_PASSWORD=` (for postgres)
2017-08-16 18:01:14 +02:00
3. run `docker-compose build --pull` to pull the most recent base images and build the custom dockerfiles
4. start nextcloud with `docker-compose up -d`
If you want to update your installation to a newer version of nextcloud, repeat the steps 3 and 4.