mirror of
https://github.com/trycua/computer.git
synced 2026-02-17 20:10:07 -06:00
Added platform detection, opened port 7860
This commit is contained in:
@@ -24,6 +24,24 @@ IMAGE_NAME="cua-dev-image"
|
||||
CONTAINER_NAME="cua-dev-container"
|
||||
PLATFORM="linux/arm64"
|
||||
|
||||
# Detect platform based on architecture
|
||||
arch=$(uname -m)
|
||||
|
||||
if [[ $arch == x86_64* ]]; then
|
||||
PLATFORM="linux/amd64"
|
||||
print_info "X64 Architecture detected, using platform: ${PLATFORM}"
|
||||
elif [[ $arch == i*86 ]]; then
|
||||
PLATFORM="linux/386"
|
||||
print_info "X32 Architecture detected, using platform: ${PLATFORM}"
|
||||
elif [[ $arch == arm* ]] || [[ $arch == aarch64 ]]; then
|
||||
PLATFORM="linux/arm64"
|
||||
print_info "ARM Architecture detected, using platform: ${PLATFORM}"
|
||||
else
|
||||
# Fallback to amd64 for unknown architectures
|
||||
PLATFORM="linux/amd64"
|
||||
print_info "Unknown architecture ($arch), defaulting to platform: ${PLATFORM}"
|
||||
fi
|
||||
|
||||
# Environment variables
|
||||
PYTHONPATH="/app/libs/core:/app/libs/computer:/app/libs/agent:/app/libs/som:/app/libs/pylume:/app/libs/computer-server"
|
||||
|
||||
@@ -56,6 +74,7 @@ case "$1" in
|
||||
-e PYTHONPATH=${PYTHONPATH} \
|
||||
-e DISPLAY=${DISPLAY:-:0} \
|
||||
-e PYLUME_HOST="host.docker.internal" \
|
||||
-p 7860:7860 \
|
||||
${IMAGE_NAME} bash
|
||||
else
|
||||
# Run the specified example
|
||||
@@ -73,6 +92,7 @@ case "$1" in
|
||||
-e PYTHONPATH=${PYTHONPATH} \
|
||||
-e DISPLAY=${DISPLAY:-:0} \
|
||||
-e PYLUME_HOST="host.docker.internal" \
|
||||
-p 7860:7860 \
|
||||
${IMAGE_NAME} python "/app/examples/$2"
|
||||
fi
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user