Skip to content
Nextcloud development environment using docker-compose
Branch: master
Clone or download
juliushaertl Cleanup setup script
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Latest commit 75bc901 May 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Cleanup setup script May 6, 2019
docker Cleanup setup script May 6, 2019
.gitignore Update gitignore May 5, 2019
README.md Cleanup setup script May 6, 2019
docker-compose.yml Cleanup setup script May 6, 2019

README.md

nextcloud-dev-docker-compose

Nextcloud development environment using docker-compose

Features

  • ☁ Nextcloud
  • 🔒 Nginx proxy with SSL termination
  • 💾 MySQL
  • 💡 Redis
  • 👥 LDAP with example user data
  • ✉ Mailhog
  • 🚀 Blackfire
  • 📄 Collabora

Getting started

Environment variables

A .env file should be created in the repository root, to keep configuration default on the dev setup:

COMPOSE_PROJECT_NAME=master

REPO_PATH_SERVER=/home/jus/repos/nextcloud/server
ADDITIONAL_APPS_PATH=/home/jus/repos/nextcloud/server/apps-extra

NEXTCLOUD_AUTOINSTALL_APPS="viewer activity"

BLACKFIRE_CLIENT_ID=
BLACKFIRE_CLIENT_TOKEN=
BLACKFIRE_SERVER_ID=
BLACKFIRE_SERVER_TOKEN=

# can be used to run separate setups besides each other
DOCKER_SUBNET=192.168.15.0/24
PORTBASE=815

# Main dns names for ssl proxy
NEXTCLOUD_DOMAIN=nextcloud.local
COLLABORA_DOMAIN=collabora.local

Starting the containers

  • Start full setup: docker-compose up
  • Minimum: docker-compose up nextcloud (nextcloud mysql redis mailhog)

Switching to different env settings

This can be useful if you wish to run different Nextcloud versions besides each other:

set -a; . stable15.env; set +a
docker-compose up nextcloud

🔒 Reverse Proxy

Used for SSL termination. To setup SSL support provide a proper NEXTCLOUD_DOMAIN environment variable and put the certificates to ./data/ssl/ named by the domain name.

You might need to add the domains to your /etc/hosts file:

127.0.0.1 nextcloud.local
127.0.0.1 collabora.local

✉ Mail

Sending/receiving mails can be tested with mailhog which is available on ports 1025 (SMTP) and 8025 (HTTP).

🚀 Blackfire

Blackfire needs to use a hostname/ip that is resolvable from within the blackfire container. Their free version is limited to local profiling so we need to browse Nextcloud though its local docker IP or add the hostname to /etc/hosts.

Using with curl

alias blackfire='docker-compose exec -e BLACKFIRE_CLIENT_ID=$BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN=$BLACKFIRE_CLIENT_TOKEN blackfire blackfire'
blackfire curl http://192.168.21.8/

👥 LDAP

Example ldif is generated using http://ldapwiki.com/wiki/LDIF%20Generator

LDAP can be setup by running the following command to autoprovision the config from data/ldap.json:

docker-compose exec nextcloud occ app:enable user_ldap

curl -X POST https://admin:admin@nextcloud.local/ocs/v2.php/apps/user_ldap/api/v1/config -H "OCS-APIREQUEST: true"

curl -X PUT https://admin:admin@nextcloud.local/ocs/v2.php/apps/user_ldap/api/v1/config/s01 -H "OCS-APIREQUEST: true" -d @data/ldap.json --header "Content-Type: application/json"

docker-compose exec nextcloud occ ldap:test-config s01

🚧 SAML

🚧 Object storage

You can’t perform that action at this time.