43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: cron-php
|
|
namespace: nextcloud
|
|
spec:
|
|
schedule: 2 * * * *
|
|
jobTemplate:
|
|
spec:
|
|
ttlSecondsAfterFinished: 100
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: nextcloud-webserver-cron
|
|
image: nextcloud:28.0.6-apache
|
|
#command: "su -s /bin/sh www-data php cron.php"
|
|
command: [ "su", "-s", "/bin/sh","www-data" ]
|
|
args:
|
|
- php cron.php
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 80
|
|
name: webserver-port
|
|
env:
|
|
- name: POSTGRES_HOST
|
|
value: "db"
|
|
volumeMounts:
|
|
- name: nextcloud-webserver
|
|
mountPath: /var/www/html
|
|
securityContext:
|
|
fsGroup: 33
|
|
|
|
restartPolicy: OnFailure
|
|
volumes:
|
|
- name: nextcloud-cron-job-php-log
|
|
hostPath:
|
|
path: /var/log/cron_job_php.log
|
|
type: File
|
|
|
|
- name: nextcloud-webserver
|
|
persistentVolumeClaim:
|
|
claimName: nextcloud-webserver
|