Better way of checking. See commit desc.

This is a better way of checking. Recommended for set and forget but not
battle tested. Original way that this replaces risks wiping data.
This commit is contained in:
j 2025-07-12 13:37:14 +10:00
parent c291399f8f
commit 5626e4fbb9

View file

@ -60,7 +60,13 @@ spec:
image: ghcr.io/linkwarden/linkwarden:latest image: ghcr.io/linkwarden/linkwarden:latest
command: ["/bin/sh", "-c"] command: ["/bin/sh", "-c"]
args: args:
- cp -r /app/. /data/ # Copy everything from the internal app dir to the mounted volume - |
if [ -z "$(ls -A /data)" ]; then
echo "/data is empty, initializing..."
cp -r /app/. /data/
else
echo "/data already initialized, skipping copy."
fi
volumeMounts: volumeMounts:
- name: linkwarden-data - name: linkwarden-data
mountPath: /data mountPath: /data