entrypoint: remove ghost directories before creating json files

This commit is contained in:
2026-08-03 19:18:03 +02:00
parent f79b74b41c
commit da7ba4b7a7
+10 -3
View File
@@ -1,6 +1,13 @@
#!/bin/sh #!/bin/sh
set -e set -e
mkdir -p /app/data /app/assets/deck-images
[ -f /app/data/colony.json ] || echo '{"games":[]}' > /app/data/colony.json mkdir -p /app/data /app/data/deck-images
[ -f /app/data/decks.json ] || echo '{"decks":[]}' > /app/data/decks.json
# Docker creates directories instead of files when a bind-mount target doesn't exist.
# Remove them so we can create proper JSON files.
for f in /app/data/colony.json /app/data/decks.json; do
[ -d "$f" ] && rm -rf "$f"
[ -f "$f" ] || echo '{}' > "$f"
done
exec node server.js exec node server.js