feat: add texture download logic to entrypoint script for initial setup
This commit is contained in:
@@ -8,6 +8,16 @@ mkdir -p /data
|
||||
chown -R node:node /data
|
||||
echo "[entrypoint] /data permissions fixed"
|
||||
|
||||
# Download textures if cache is empty (first run)
|
||||
TEXTURE_DIR="/data/texture-cache/minecraft"
|
||||
if [ ! -d "$TEXTURE_DIR" ] || [ -z "$(ls -A "$TEXTURE_DIR" 2>/dev/null)" ]; then
|
||||
echo "[entrypoint] Downloading textures (first run)..."
|
||||
su-exec node node /app/download-textures.js /data/texture-cache
|
||||
echo "[entrypoint] Texture download complete"
|
||||
else
|
||||
echo "[entrypoint] Texture cache exists, skipping download"
|
||||
fi
|
||||
|
||||
# Drop privileges and exec the CMD
|
||||
echo "[entrypoint] Dropping to user 'node', running: $*"
|
||||
exec su-exec node "$@"
|
||||
|
||||
Reference in New Issue
Block a user