Copy complete /usr/local and fix all Erlang paths

This commit is contained in:
Andreas Dueren
2025-06-20 18:25:21 -06:00
parent 89b9cefb8c
commit 1f81b1a775
2 changed files with 14 additions and 11 deletions

View File

@ -52,20 +52,26 @@ if [[ ! -f "/app/data/root_credentials" ]]; then
chmod 600 /app/data/root_credentials
fi
# Create complete Erlang runtime structure
# Create complete Erlang runtime structure to fix paths
echo "==> Setting up Erlang runtime"
ERTS_DIR=$(find /usr/local/lib/erlang -name "erts-*" -type d | head -1)
if [[ -n "$ERTS_DIR" ]]; then
echo "Setting up Erlang from: $ERTS_DIR"
# Create the exact structure Keila expects
# Create the exact structure Keila expects at both possible locations
rm -rf /app/data/keila/erts-14.2.5
cp -r "$ERTS_DIR" /app/data/keila/erts-14.2.5
chown -R cloudron:cloudron /app/data/keila/erts-14.2.5
# Also create symlink from the releases directory
cd /app/data/keila/releases/0.14.11
ln -sf ../../erts-14.2.5 ./erts-14.2.5
cd /app/code
# Create symlink in the releases directory for relative path resolution
mkdir -p /app/data/keila/releases/0.14.11/erts-14.2.5
rm -rf /app/data/keila/releases/0.14.11/erts-14.2.5
ln -sf ../../../erts-14.2.5 /app/data/keila/releases/0.14.11/erts-14.2.5
# Also ensure the bin directory is accessible
ln -sf /usr/local/bin/erl /app/data/keila/erts-14.2.5/bin/dyn_erl
echo "Created Erlang symlinks for path resolution"
fi
echo "==> Running database migrations"