Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Kube-Nextcloud: Nextcloud tailored for Kubernetes / OpenShift

## Current version
Nextcloud 15.0.7
PHP 7.2
Nextcloud 21.0.1
PHP 7.3

## WHAT'S THIS?
This is a distribution of [Nextcloud](https://nextcloud.com) that is tailored for running on Kubernetes or OpenShift.
Expand Down
132 changes: 132 additions & 0 deletions deploy/kubernetes/examples/kube-nextcloud/nextcloud-dc
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
kind: DeploymentConfig
apiVersion: apps.openshift.io/v1
metadata:
name: kube-nextcloud
labels:
app: kube-nextcloud
spec:
strategy:
type: Recreate
recreateParams:
timeoutSeconds: 600
rollingParams:
updatePeriodSeconds: 1
intervalSeconds: 1
timeoutSeconds: 600
maxUnavailable: 25%
maxSurge: 25%
resources: {}
activeDeadlineSeconds: 21600
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- nextcloud
- init-kube-nextcloud
from:
kind: ImageStreamTag
namespace: nextcloud
name: 'nextcloud:latest-ocpbuild'
- type: ConfigChange
replicas: 1
revisionHistoryLimit: 10
test: false
selector:
app: nextcloud
deploymentconfig: nextcloud
template:
metadata:
creationTimestamp: null
labels:
app: nextcloud
deploymentconfig: nextcloud
annotations:
openshift.io/generated-by: OpenShiftWebConsole
spec:
volumes:
- name: tmp
emptyDir: {}
- name: nextcloud-data
persistentVolumeClaim:
claimName: kube-nextcloud-data
- name: nextcloud-config
configMap:
name: kube-nextcloud-config
items:
- key: custom.config.php
path: custom.config.php
defaultMode: 420
initContainers:
- name: init-kube-nextcloud
command:
- bash
- '-c'
- >
mkdir -p /vol/nextcloud-data/{config,data,custom_apps}

chmod 770 /vol/nextcloud-data/data || true

cp -f /var/www/html/config/* /vol/nextcloud-data/config

ln -sf /etc/nextcloud/custom.config.php
/vol/nextcloud-data/config/
resources: {}
volumeMounts:
- name: nextcloud-data
mountPath: /vol/nextcloud-data
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: Always
containers:
- resources:
limits:
memory: 2300Mi
terminationMessagePath: /dev/termination-log
name: nextcloud
env:
- name: NEXTCLOUD_DATA_DIR
value: /var/www/html/data
- name: MYSQL_DATABASE
value: nexycloud
- name: MYSQL_USER
value: changeme
- name: MYSQL_PASSWORD
value: changeme
- name: MYSQL_HOST
value: changeme
- name: REDIS_HOST
value: changeme
- name: REDIS_HOST_PASS
value: changeme
- name: HOME
value: /var/www/html
ports:
- containerPort: 8080
protocol: TCP
imagePullPolicy: IfNotPresent
volumeMounts:
- name: tmp
mountPath: /tmp/nextcloudtemp
- name: nextcloud-data
mountPath: /var/www/html/data
subPath: data
- name: nextcloud-data
mountPath: /var/www/html/.cache
subPath: .cache
- name: nextcloud-data
mountPath: /var/www/html/config
subPath: config
- name: nextcloud-data
mountPath: /var/www/html/custom_apps
subPath: custom_apps
- name: nextcloud-data
mountPath: /vol/nextcloud-data
- name: nextcloud-config
mountPath: /etc/nextcloud
terminationMessagePolicy: File
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
14 changes: 9 additions & 5 deletions images/kube-nextcloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nextcloud 15 on CentOS 7.6
# Manual installation instructions: https://docs.nextcloud.com/server/15/admin_manual/installation/source_installation.html#example-installation-on-centos-7-server
FROM docker.io/centos:7
FROM quay.io/centos/centos:centos7
LABEL name="kube-nextcloud" \
description="Nextcould container image for Kubernetes/OpenShift, based on CentOS 7" \
maintainer="Yuxiang Zhu <vfreex@gmail.com>"
Expand All @@ -9,11 +9,12 @@ LABEL name="kube-nextcloud" \
RUN yum -y install centos-release-scl bzip2 \
&& yum -y install httpd24-httpd rh-php73 rh-php73-php rh-php73-php-gd rh-php73-php-mbstring \
rh-php73-php-intl rh-php73-php-pecl-apcu rh-php73-php-mysqlnd rh-php73-php-pecl-redis \
rh-php73-php-opcache rh-php73-php-pecl-memcached rh-php73-php-imagick rh-php73-php-ldap rh-php73-php-pgsql \
rh-php73-php-opcache sclo-php73-php-smbclient rh-php73-php-pecl-memcached rh-php73-php-imagick rh-php73-php-ldap rh-php73-php-pgsql \
rh-php73-php-bcmath rh-php73-php-gmp \
&& yum clean all

# install Nextcloud to /var/www/html
ENV NEXTCLOUD_VERSION=20.0.2
ENV NEXTCLOUD_VERSION=21.0.5

RUN DL_DIR=$(mktemp -d) \
&& curl --fail -L -o "${DL_DIR}/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \
Expand Down Expand Up @@ -44,7 +45,9 @@ COPY httpd-conf.d /etc/httpd/conf.d
# configure PHP
# see https://docs.nextcloud.com/server/15/admin_manual/installation/server_tuning.html#enable-php-opcache
ENV PHP_CONFIG_DIR=/etc/opt/rh/rh-php73 \
PHP_DATA_DIR=/var/opt/rh/rh-php73/lib/php
PHP_DATA_DIR=/var/opt/rh/rh-php73/lib/php \
PATH=$PATH:/opt/rh/rh-php73/root/bin

RUN { \
echo 'opcache.enable=1'; \
echo 'opcache.enable_cli=1'; \
Expand All @@ -67,7 +70,8 @@ COPY config /var/www/html/config
# set up volume directories
RUN mkdir -p /var/www/html/{data,custom_apps,config} \
&& chown apache:root -R /var/www/html/{data,custom_apps,config} \
&& chmod u=rwX,g=rwX,o= -R /var/www/html/{data,custom_apps,config,.htaccess,.user.ini}
&& chmod u=rwX,g=rwX,o= -R /var/www/html/{data,custom_apps,config,.htaccess,.user.ini} \
&& chmod a=rwx /var/www/html/occ

# startup scripts
COPY scripts /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion images/kube-nextcloud/scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

source scl_source enable rh-php72
source scl_source enable rh-php73
source scl_source enable httpd24

exec "$@"