This repository contains an OpenShift 3 template to easily deploy Nextcloud on OpenShift. With this template it's possible to run your own Nextcloud instance f.e. on APPUiO.
Create an OpenShift project if not already provided by the service
PROJECT=nextcloud
oc new-project $PROJECT
oc -n openshift process mariadb-persistent -p MYSQL_DATABASE=nextcloud | oc -n $PROJECT create -f -
oc process -f https://raw.githubusercontent.com/tobru/nextcloud-openshift/master/nextcloud.yaml -p NEXTCLOUD_HOST=nextcloud.example.com | oc -n $PROJECT create -f -
Execute the following command to get the available parameters:
oc process -f https://raw.githubusercontent.com/tobru/nextcloud-openshift/master/nextcloud.yaml --parameters
- Navigate to http://nextcloud.example.com
- Fill in the form and finish the installation. The DB credentials can be
found in the secret
mariadb
. In the Webconsole it can be found underResources -> Secrets -> mariadb -> Reveal Secret
Hints
- You might want to enable TLS for your instance
You can use the provided DB dump CronJob
template:
oc process -f https://raw.githubusercontent.com/tobru/nextcloud-openshift/master/mariadb-backup.yaml | oc -n MYNAMESPACE create -f -
This script dumps the DB to the same PV as the database stores it's data. You must make sure that you copy these files away to a real backup location.
To backup files, a simple solution would be to run f.e. restic in a Pod
as a CronJob
and mount the PVCs as volumes. Then use an S3 endpoint for restic
to backup data to.
- Nextcloud Cronjob is called from a
CronJob
object every 15 minutes - The Dockerfile just add the
nginx.conf
to the Alpine Nginx container
To use the occ
CLI, you can use oc exec
:
oc get pods
oc exec NEXTCLOUDPOD -c nextcloud -ti php occ
- Use sclorg Nginx instead of Alpine Nginx for better OpenShift compatibility
- Autoconfigure Nextcloud using
autoconfig.php
- Provide restic Backup example
Very welcome!
- Fork it (https://github.com/tobru/nextcloud-openshift/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request