From da7ba4b7a710cceb41e590604cca19579c7a1d50 Mon Sep 17 00:00:00 2001 From: Olov Johansson Date: Mon, 3 Aug 2026 19:18:03 +0200 Subject: [PATCH] entrypoint: remove ghost directories before creating json files --- entrypoint.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 1c9695a..b52fcb7 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,13 @@ #!/bin/sh set -e -mkdir -p /app/data /app/assets/deck-images -[ -f /app/data/colony.json ] || echo '{"games":[]}' > /app/data/colony.json -[ -f /app/data/decks.json ] || echo '{"decks":[]}' > /app/data/decks.json + +mkdir -p /app/data /app/data/deck-images + +# 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