Last active 1705433071

Podman pod definition for Nextcloud, using ghcr.io/0ranki/nextcloud-previews image (includes video preview dependencies)

nextcloud.yaml Raw
1apiVersion: v1
2kind: ConfigMap
3metadata:
4 name: nextcloud-config
5data:
6 POSTGRES_USER: postgres_username
7 POSTGRES_DB: postgres_db_for_nextcloud_name
8 POSTGRES_PASSWORD: postgres_password
9 POSTGRES_HOST: 127.0.0.1 # Don't change unless using a separate DB
10 NEXTCLOUD_ADMIN_USER: nextcloud-admin
11 NEXTCLOUD_ADMIN_PASSWORD: nextcloud-admin-password
12 NEXTCLOUD_TRUSTED_DOMAINS: nextcloud.example.com 192.168.23.45
13 REDIS_HOST: 127.0.0.1
14 REDIS_PORT: 6379
15 ## Tune these if necessary
16 PHP_MEMORY_LIMIT: 3G
17 PHP_UPLOAD_LIMIT: 10G
18 TZ: Europe/Helsinki
19---
20apiVersion: v1
21kind: Pod
22metadata:
23 name: nextcloud
24 creationTimestamp: "2022-05-25T09:38:11Z"
25 labels:
26 app: nextcloud
27 annotations:
28spec:
29 volumes:
30 - hostPath:
31 path: /path/to/clamav/config/directory/on/host ## EDIT
32 type: Directory
33 name: clamav-config-host-1
34 - hostPath:
35 path: /path/to/nextcloud/webroot/on/host ## EDIT
36 type: Directory
37 name: nextcloud-app-host-0
38 - hostPath:
39 path: /path/to/redis/dump/on/host ## EDIT
40 type: Directory
41 name: nextcloud-redis-host-0
42 - name: clamav-db
43 persistentVolumeClaim:
44 claimName: clamav-db
45 - name: nextcloud-psql
46 persistentVolumeClaim:
47 claimName: nextcloud-psql
48 containers:
49
50 - name: clamav
51 image: docker.io/clamav/clamav:latest
52 #image: ghcr.io/0ranki/clamav-docker-arm64:v1.1.0
53 resources: {}
54 securityContext:
55 capabilities:
56 drop:
57 - CAP_MKNOD
58 - CAP_NET_RAW
59 - CAP_AUDIT_WRITE
60 volumeMounts:
61 - mountPath: /var/lib/clamav
62 name: clamav-db
63 - mountPath: /etc/clamav
64 name: clamav-config-host-1
65
66 - name: redis
67 image: docker.io/library/redis:alpine
68 args:
69 - redis-server
70 - --save
71 - 60
72 - 1
73 - --loglevel
74 - warning
75 resources: {}
76 securityContext:
77 capabilities:
78 drop:
79 - CAP_MKNOD
80 - CAP_NET_RAW
81 - CAP_AUDIT_WRITE
82 volumeMounts:
83 - mountPath: /data
84 name: nextcloud-redis-host-0
85
86 - name: psql
87 image: docker.io/postgres:14-alpine
88 args:
89 - postgres
90 command:
91 - docker-entrypoint.sh
92 envFrom:
93 - configMapRef:
94 name: nextcloud-config
95 optional: false
96 resources: {}
97 securityContext:
98 allowPrivilegeEscalation: true
99 capabilities:
100 drop:
101 - CAP_MKNOD
102 - CAP_NET_RAW
103 - CAP_AUDIT_WRITE
104 privileged: false
105 readOnlyRootFilesystem: false
106 seLinuxOptions: {}
107 volumeMounts:
108 - mountPath: /var/lib/postgresql/data
109 name: nextcloud-psql
110 workingDir: /
111
112 - name: app
113 ## Remember to change cron container version!
114 image: ghcr.io/0ranki/nextcloud-previews/nextcloud:latest
115 ## Remember to change cron container version!
116 #imagePullPolicy: never
117 ports:
118 - containerPort: 80
119 hostPort: 8082
120 envFrom:
121 - configMapRef:
122 name: nextcloud-config
123 optional: false
124 resources: {}
125 securityContext:
126 capabilities:
127 drop:
128 - CAP_MKNOD
129 - CAP_NET_RAW
130 - CAP_AUDIT_WRITE
131 volumeMounts:
132 - mountPath: /var/www/html
133 name: nextcloud-app-host-0
134
135 - name: cron
136 # Remember to change main image version!
137 image: ghcr.io/0ranki/nextcloud-previews/nextcloud:latest
138 # Remember to change main image version!
139 #imagePullPolicy: never
140 args:
141 - busybox
142 - crond
143 - -f
144 - -l
145 - 0
146 - -L
147 - /dev/stdout
148 env:
149 - name: TZ
150 value: Europe/Helsinki
151 resources: {}
152 securityContext:
153 capabilities:
154 drop:
155 - CAP_MKNOD
156 - CAP_NET_RAW
157 - CAP_AUDIT_WRITE
158 volumeMounts:
159 - mountPath: /var/www/html
160 name: nextcloud-app-host-0
161
162# - name: cloudflared
163# image: docker.io/cloudflare/cloudflared:latest
164# args:
165# - tunnel
166# - --no-autoupdate
167# - run
168# - --token
169# - ### CLOUDFLARE TOKEN TÄHÄN ###
170# resources: {}
171# securityContext: {}
172
173 restartPolicy: Always
174
175status: {}
pod-nextcloud.service Raw
1[Unit]
2Description=Podman pod - Nextcloud
3After=network-online.target
4AssertPathExists=/path/to/nextcloud/webroot/on/host
5
6[Service]
7Type=forking
8Restart=on-failure
9RestartSec=30
10ExecStartPre=/path/to/nextcloud/webroot/on/host/bin/fix-htaccess
11ExecStart=podman play kube --replace /path/to/nextcloud.yaml
12ExecStop=podman play kube --down /path/to/nextcloud.yaml
13## Uncomment to export named volumes after stopping the pod
14#ExecStopPost=podman volume export -o /path/to/clamav-db.tar clamav-db
15#ExecStopPost=podman volume export -o /path/to/nextcloud-psql.tar nextcloud-psql
16
17
18[Install]
19WantedBy=default.target