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