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

@ -6,12 +6,9 @@ RUN apt-get update && apt-get install -y \
supervisor \ supervisor \
&& rm -rf /var/lib/apt/lists/* && 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 /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 /usr/local
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 configuration files # Copy configuration files
COPY start.sh /app/code/start.sh COPY start.sh /app/code/start.sh

View File

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