refactor(docker): switch to Node.js base image and optimize Bun installation

- Replace Bun base image with Node.js slim image
- Install Bun globally using npm in both builder and runner stages
- Simplify Docker build process and dependency management
- Remove unnecessary environment variables and build flags
- Update docker-build.sh to use BuildKit and remove lockfile before build
This commit is contained in:
jango-blockchained
2025-02-04 20:18:46 +01:00
parent 849b080aba
commit 905339fb67
2 changed files with 18 additions and 14 deletions

View File

@@ -28,9 +28,12 @@ CPU_QUOTA=$(( CPU_COUNT * 50000 )) # Allow 50% CPU usage per core
echo "Building with ${BUILD_MEM}MB memory limit and CPU quota ${CPU_QUOTA}"
# Remove any existing lockfile
rm -f bun.lockb
# Build with resource limits, optimizations, and timeout
echo "Building Docker image..."
timeout 15m docker build \
DOCKER_BUILDKIT=1 docker build \
--memory="${BUILD_MEM}m" \
--memory-swap="${BUILD_MEM}m" \
--cpu-quota="${CPU_QUOTA}" \