Skip to content

Commit 2415efa

Browse files
committed
corrects entrypoint.sh to correctly execute the correct binary and passes in env vars
1 parent e1393bd commit 2415efa

File tree

1 file changed

+8
-32
lines changed

1 file changed

+8
-32
lines changed

entrypoint.sh

+8-32
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,11 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
# Determine the architecture of the host machine
5-
ARCH=$(uname -m)
6-
7-
# Set Rust linker for ARM64 if needed
8-
if [ "$ARCH" = "aarch64" ]; then
9-
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
10-
export RUSTFLAGS="-C link-arg=-L/usr/lib/aarch64-linux-gnu"
11-
fi
12-
13-
# Select the binary based on the architecture
14-
if [ "$ARCH" = "x86_64" ]; then
15-
echo "Executing AMD64 binary"
16-
exec /app/refactor_platform_rs \
17-
-l "$BACKEND_LOG_FILTER_LEVEL" \
18-
-i "$BACKEND_INTERFACE" \
19-
-p "$BACKEND_PORT" \
20-
-d "$DATABASE_URL" \
21-
--allowed-origins="$BACKEND_ALLOWED_ORIGINS" \
22-
"$@"
23-
elif [ "$ARCH" = "aarch64" ]; then
24-
echo "Executing ARM64 binary"
25-
exec /app/refactor_platform_rs_arm64 \
26-
-l "$BACKEND_LOG_FILTER_LEVEL" \
27-
-i "$BACKEND_INTERFACE" \
28-
-p "$BACKEND_PORT" \
29-
-d "$DATABASE_URL" \
30-
--allowed-origins="$BACKEND_ALLOWED_ORIGINS" \
31-
"$@"
32-
else
33-
echo "Unsupported architecture: $(uname -m)" >&2
34-
exit 1
35-
fi
4+
# Start the main Rust binary with runtime args/envs
5+
exec /app/refactor_platform_rs \
6+
-l "$BACKEND_LOG_FILTER_LEVEL" \
7+
-i "$BACKEND_INTERFACE" \
8+
-p "$BACKEND_PORT" \
9+
-d "$DATABASE_URL" \
10+
--allowed-origins="$BACKEND_ALLOWED_ORIGINS" \
11+
"$@"

0 commit comments

Comments
 (0)