From 8ac62fdeb22eab7aa4bda3809d0ad734a6e0e1a0 Mon Sep 17 00:00:00 2001 From: sonoflope Date: Thu, 24 Oct 2024 14:12:06 -0400 Subject: [PATCH] Issue #408: init to browser --- .../aks/apps/fertiscan/base/filebrowser.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/kubernetes/aks/apps/fertiscan/base/filebrowser.yaml b/kubernetes/aks/apps/fertiscan/base/filebrowser.yaml index 520f700d..71215fb6 100644 --- a/kubernetes/aks/apps/fertiscan/base/filebrowser.yaml +++ b/kubernetes/aks/apps/fertiscan/base/filebrowser.yaml @@ -14,6 +14,19 @@ spec: labels: app: filebrowser spec: + initContainers: + - name: init-db + image: alpine + command: + - "/bin/sh" + - "-c" + - | + if [ ! -f /db/database.db ]; then + touch /db/database.db && echo "Database file created"; + fi + volumeMounts: + - name: filebrowser-db + mountPath: /db containers: - name: file-browser image: filebrowser/filebrowser @@ -33,9 +46,6 @@ spec: - "/bin/sh" - "-c" - | - if [ ! -f /db/database.db ]; then - /filebrowser config init --database=/db/database.db; - fi /filebrowser config set --auth.method=proxy --auth.header=X-Vouch-Token && \ /filebrowser -r /srv -d /db/database.db volumes: @@ -48,7 +58,6 @@ spec: - name: filebrowser-db persistentVolumeClaim: claimName: filebrowser-db-pvc - --- apiVersion: v1 kind: PersistentVolumeClaim