Public | Automated Build

Last pushed: 8 days ago
Short Description
Nextcloud to be connected to an official MySQL container.
Full Description

Docker Image for Nextcloud

Configuration

  • Port: 80
  • Volumes:
    • /var/www/nextcloud/data
    • /var/www/nextcloud/config
  • Variables:
    • URL: URL of the service. Should always be specified, at least if service is behind a proxy. E.g. https://example.com/nextcloudURL="example.com"
    • WEBROOT: Path in URL, must be set for proper forwarding id URL conrtains a path, e.g. https://example.com/nextcloudWEBROOT="/nextcloud"
    • ADMIN_USER: Name of the administration user. Default: admin
    • ADMIN_PWD: Password of the administration user. Default: random (printed in the log)
    • APPS: List of additional apps to install and enable, e.g. files_external, user_ldap, etc. → see https://apps.nextcloud.com/ for more
    • UPLOAD_MAX_FILESIZE: Maximum size of files to upload. Default: 8G
    • MAX_INPUT_TIME: Timeout for apache in seconds , maximum response time. Dafault: 3600
    • DEBUG: Set to 1 to enable debugging. Default: 0

Examples

Real Live Example Proxy

Example use with volumes and MySQL database behind a reverse proxy:

appname=nextcloud
url=cloud.example.com
docker pull mwaeckerlin/nextcloud
docker pull mysql
docker run -d --restart unless-stopped --name ${appname}-mysql-volume mysql sleep infinity
docker run -d --restart unless-stopped --name ${appname}-volume mwaeckerlin/nextcloud sleep infinity
docker run -d --restart unless-stopped --name ${appname}-mysql -e MYSQL_ROOT_PASSWORD=$(pwgen 20 1) -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=$(pwgen 20 1) --volumes-from ${appname}-mysql-volume mysql

Behind a reverse proxy:

docker run -d --restart unless-stopped --name ${appname} -e URL="${url}" -e UPLOAD_MAX_FILESIZE=16G -e MAX_INPUT_TIME=7200 -e ADMIN_PWD=$(pwgen 20 1) --volumes-from ${appname}-volume --link ${appname}-mysql:mysql mwaeckerlin/nextcloud
docker run -d -p 80:80 -p 443:443 [...] --link ${appname}:${url} mwaeckerlin/reverse-proxy

Or when exposing the port, e.g. to http://localhost:8000:

docker run -d --restart unless-stopped -p 8000:80 --name ${appname} -e URL="${url}" -e UPLOAD_MAX_FILESIZE=16G -e MAX_INPUT_TIME=7200 -e ADMIN_PWD=$(pwgen 20 1) --volumes-from ${appname}-volume --link ${appname}-mysql:mysql mwaeckerlin/nextcloud

Check the logs:

docker logs -f ${appname}

It is initialied and ready, when you see in the logs:

#### READY ####

Simplest Call for Tests

docker rm -f test-nc-mysql
docker run -d --name test-nc-mysql -e MYSQL_ROOT_PASSWORD=$(pwgen 20 1) -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=ert456 mysql
docker run --rm -it -p 9000:80 --name test-nc -e ADMIN_PWD=ert456 --link test-nc-mysql:mysql mwaeckerlin/nextcloud bash
/start.sh

Admin Password

How to get the admin password depends, how you started. If you specified it with ADMIN_PWD on command line, you have several options:

Simply get the environment variable:

docker exec -it ${appname} env | grep ADMIN_PWD

Get it from docker inspect:

docker inspect ${appname} | grep ADMIN_PWD

Or use my backup toolset to get the full command line:

./docker-analysis.py ${appname}

But if the password was not set and is generated randomly, you only find it in the log of the first start, so do not forget it:

docker logs ${appname} | grep 'admin-password'
Docker Pull Command
Owner
mwaeckerlin
Source Repository

Comments (0)