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:
parent
c291399f8f
commit
5626e4fbb9
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue