From 1f81b1a7755aec50073e1d6fd8563862e783c474 Mon Sep 17 00:00:00 2001 From: Andreas Dueren Date: Fri, 20 Jun 2025 18:25:21 -0600 Subject: [PATCH] Copy complete /usr/local and fix all Erlang paths --- Dockerfile | 7 ++----- start.sh | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 28dda1f..bbd4b9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,12 +6,9 @@ RUN apt-get update && apt-get install -y \ supervisor \ && rm -rf /var/lib/apt/lists/* -# Copy entire Keila app and complete Erlang runtime from official image +# Copy entire Keila app and ALL Erlang-related files from official image COPY --from=pentacent/keila:0.14 /opt/app /app/pkg -COPY --from=pentacent/keila:0.14 /usr/local/lib/erlang /usr/local/lib/erlang -COPY --from=pentacent/keila:0.14 /usr/local/bin/erl /usr/local/bin/erl -COPY --from=pentacent/keila:0.14 /usr/local/bin/erlc /usr/local/bin/erlc -COPY --from=pentacent/keila:0.14 /usr/local/bin/escript /usr/local/bin/escript +COPY --from=pentacent/keila:0.14 /usr/local /usr/local # Copy configuration files COPY start.sh /app/code/start.sh diff --git a/start.sh b/start.sh index a7f30a5..7f83544 100644 --- a/start.sh +++ b/start.sh @@ -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"