From fa2e0b8cf067eae5e2f38c50d884ef84b92ed469 Mon Sep 17 00:00:00 2001 From: Vivian Phung Date: Thu, 11 Apr 2024 18:23:45 -0500 Subject: [PATCH] bun package management support for nextjs & webapps --- .../data/container-build/cerc-nextjs-base/Dockerfile | 2 ++ .../cerc-nextjs-base/scripts/apply-runtime-env.sh | 2 ++ .../data/container-build/cerc-nextjs-base/scripts/build-app.sh | 2 ++ .../cerc-nextjs-base/scripts/start-serving-app.sh | 2 ++ .../data/container-build/cerc-webapp-base/Dockerfile | 2 ++ .../data/container-build/cerc-webapp-base/scripts/build-app.sh | 2 ++ 6 files changed, 12 insertions(+) diff --git a/stack_orchestrator/data/container-build/cerc-nextjs-base/Dockerfile b/stack_orchestrator/data/container-build/cerc-nextjs-base/Dockerfile index d3ae8237..1cc29945 100644 --- a/stack_orchestrator/data/container-build/cerc-nextjs-base/Dockerfile +++ b/stack_orchestrator/data/container-build/cerc-nextjs-base/Dockerfile @@ -28,6 +28,8 @@ RUN \ && su ${USERNAME} -c "umask 0002 && npm install -g semver" \ # Install pnpm && su ${USERNAME} -c "umask 0002 && npm install -g pnpm" \ + # Install bun + && su ${USERNAME} -c "umask 0002 && npm install -g bun@1.1.x" \ && npm cache clean --force > /dev/null 2>&1 # [Optional] Uncomment this section to install additional OS packages. diff --git a/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/apply-runtime-env.sh b/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/apply-runtime-env.sh index ba0f725f..79aa0c02 100755 --- a/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/apply-runtime-env.sh +++ b/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/apply-runtime-env.sh @@ -14,6 +14,8 @@ if [ -z "$CERC_BUILD_TOOL" ]; then CERC_BUILD_TOOL=pnpm elif [ -f "yarn.lock" ]; then CERC_BUILD_TOOL=yarn + elif [ -f "bun.lockb" ]; then + CERC_BUILD_TOOL=bun else CERC_BUILD_TOOL=npm fi diff --git a/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/build-app.sh b/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/build-app.sh index 882ae05d..4e769224 100755 --- a/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/build-app.sh +++ b/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/build-app.sh @@ -13,6 +13,8 @@ if [ -z "$CERC_BUILD_TOOL" ]; then CERC_BUILD_TOOL=pnpm elif [ -f "yarn.lock" ]; then CERC_BUILD_TOOL=yarn + elif [ -f "bun.lockb" ]; then + CERC_BUILD_TOOL=bun else CERC_BUILD_TOOL=npm fi diff --git a/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/start-serving-app.sh b/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/start-serving-app.sh index 4b69d935..54cdf237 100755 --- a/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/start-serving-app.sh +++ b/stack_orchestrator/data/container-build/cerc-nextjs-base/scripts/start-serving-app.sh @@ -20,6 +20,8 @@ if [ -z "$CERC_BUILD_TOOL" ]; then CERC_BUILD_TOOL=pnpm elif [ -f "yarn.lock" ]; then CERC_BUILD_TOOL=yarn + elif [ -f "bun.lockb" ]; then + CERC_BUILD_TOOL=bun else CERC_BUILD_TOOL=npm fi diff --git a/stack_orchestrator/data/container-build/cerc-webapp-base/Dockerfile b/stack_orchestrator/data/container-build/cerc-webapp-base/Dockerfile index 5b119b31..b9e4740a 100644 --- a/stack_orchestrator/data/container-build/cerc-webapp-base/Dockerfile +++ b/stack_orchestrator/data/container-build/cerc-webapp-base/Dockerfile @@ -28,6 +28,8 @@ RUN \ && su ${USERNAME} -c "umask 0002 && npm install -g semver" \ # Install pnpm && su ${USERNAME} -c "umask 0002 && npm install -g pnpm" \ + # Install bun + && su ${USERNAME} -c "umask 0002 && npm install -g bun@1.1.x" \ && npm cache clean --force > /dev/null 2>&1 # [Optional] Uncomment this section to install additional OS packages. diff --git a/stack_orchestrator/data/container-build/cerc-webapp-base/scripts/build-app.sh b/stack_orchestrator/data/container-build/cerc-webapp-base/scripts/build-app.sh index 30358bbd..ce6be2f9 100755 --- a/stack_orchestrator/data/container-build/cerc-webapp-base/scripts/build-app.sh +++ b/stack_orchestrator/data/container-build/cerc-webapp-base/scripts/build-app.sh @@ -27,6 +27,8 @@ elif [ -f "${WORK_DIR}/package.json" ]; then CERC_BUILD_TOOL=pnpm elif [ -f "yarn.lock" ]; then CERC_BUILD_TOOL=yarn + elif [ -f "bun.lockb" ]; then + CERC_BUILD_TOOL=bun else CERC_BUILD_TOOL=npm fi