From c1be096bb85453e9b95f9cbfc914d18a0f1a6c98 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 22 Oct 2025 09:53:19 +0200 Subject: [PATCH 1/5] use specific bun version also in Dockerfiles and deployement script --- admin/Dockerfile | 4 ++- backend/Dockerfile | 5 +-- database/Dockerfile | 4 ++- deployment/bare_metal/install-missing-deps.sh | 35 +++++++++++++------ dht-node/Dockerfile | 5 +-- federation/Dockerfile | 5 +-- frontend/Dockerfile | 4 ++- 7 files changed, 43 insertions(+), 19 deletions(-) diff --git a/admin/Dockerfile b/admin/Dockerfile index 0ad7be7af..41b1bbab1 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -57,7 +57,9 @@ WORKDIR ${DOCKER_WORKDIR} FROM base as bun-base RUN apk update && apk add --no-cache curl tar bash -RUN curl -fsSL https://bun.sh/install | bash +COPY .bun-version .bun-version +RUN BUN_VERSION=$(cat .bun-version) && \ + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" # Add bun's global bin directory to PATH ENV PATH="/root/.bun/bin:${PATH}" diff --git a/backend/Dockerfile b/backend/Dockerfile index 4ab2f1883..eeab1ac17 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -54,8 +54,9 @@ WORKDIR ${DOCKER_WORKDIR} FROM base as bun-base RUN apt update && apt install -y --no-install-recommends ca-certificates curl bash unzip -#RUN apk update && apk add --no-cache curl tar bash -RUN curl -fsSL https://bun.sh/install | bash +COPY .bun-version .bun-version +RUN BUN_VERSION=$(cat .bun-version) && \ + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" # Add bun's global bin directory to PATH ENV PATH="/root/.bun/bin:${PATH}" diff --git a/database/Dockerfile b/database/Dockerfile index cbcaddc73..f6d50e7f2 100644 --- a/database/Dockerfile +++ b/database/Dockerfile @@ -46,7 +46,9 @@ FROM base as bun-base #RUN apt update && apt install -y --no-install-recommends ca-certificates curl bash unzip RUN apk update && apk add --no-cache curl tar bash -RUN curl -fsSL https://bun.sh/install | bash +COPY .bun-version .bun-version +RUN BUN_VERSION=$(cat .bun-version) && \ + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" # Add bun's global bin directory to PATH ENV PATH="/root/.bun/bin:${PATH}" diff --git a/deployment/bare_metal/install-missing-deps.sh b/deployment/bare_metal/install-missing-deps.sh index 52c1f7fab..5e538c6ae 100644 --- a/deployment/bare_metal/install-missing-deps.sh +++ b/deployment/bare_metal/install-missing-deps.sh @@ -19,19 +19,34 @@ install_nvm() { } nvm use || install_nvm -# check for some tools and install them, when missing -# bun https://bun.sh/install, faster packet-manager as yarn -if ! command -v bun &> /dev/null +# unzip needed for bun install script +if ! command -v unzip &> /dev/null then - if ! command -v unzip &> /dev/null - then - echo "'unzip' is missing, will be installed now!" - sudo apt-get install -y unzip - fi - echo "'bun' is missing, will be installed now!" - curl -fsSL https://bun.sh/install | bash + echo "'unzip' is missing, will be installed now!" + sudo apt-get install -y unzip +fi + +# check for some tools and install them, when missing +# bun https://bun.com/install, faster packet-manager as yarn +BUN_VERSION_FILE="$(dirname "$0")/../../.bun-version" +if [ ! -f "$BUN_VERSION_FILE" ]; then + echo ".bun-version file not found at: $BUN_VERSION_FILE" + exit 1 +fi +BUN_VERSION="$(cat "$BUN_VERSION_FILE" | tr -d '[:space:]')" +if ! command -v bun &> /dev/null +then + echo "'bun' is missing, v$BUN_VERSION will be installed now!" + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" export BUN_INSTALL="$HOME/.bun" export PATH="$BUN_INSTALL/bin:$PATH" +else + CURRENT_VERSION="$(bun --version | tr -d '[:space:]')" + if [ "$CURRENT_VERSION" != "$BUN_VERSION" ] + then + echo "'bun' is outdated, v$BUN_VERSION will be installed now!" + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" + fi fi # turbo https://turborepo.com/docs/getting-started if ! command -v turbo &> /dev/null diff --git a/dht-node/Dockerfile b/dht-node/Dockerfile index c19888a5d..963e093d6 100644 --- a/dht-node/Dockerfile +++ b/dht-node/Dockerfile @@ -57,8 +57,9 @@ WORKDIR ${DOCKER_WORKDIR} FROM base as bun-base RUN apt update && apt install -y --no-install-recommends ca-certificates curl bash unzip -#RUN apk update && apk add --no-cache curl tar bash -RUN curl -fsSL https://bun.sh/install | bash +COPY .bun-version .bun-version +RUN BUN_VERSION=$(cat .bun-version) && \ + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" # Add bun's global bin directory to PATH ENV PATH="/root/.bun/bin:${PATH}" diff --git a/federation/Dockerfile b/federation/Dockerfile index a8fcfd769..c3a45bf3d 100644 --- a/federation/Dockerfile +++ b/federation/Dockerfile @@ -55,8 +55,9 @@ WORKDIR ${DOCKER_WORKDIR} FROM base as bun-base RUN apt update && apt install -y --no-install-recommends ca-certificates curl bash unzip -#RUN apk update && apk add --no-cache curl tar bash -RUN curl -fsSL https://bun.sh/install | bash +COPY .bun-version .bun-version +RUN BUN_VERSION=$(cat .bun-version) && \ + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" # Add bun's global bin directory to PATH ENV PATH="/root/.bun/bin:${PATH}" diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 23ca0685e..05e9e2255 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -57,7 +57,9 @@ WORKDIR ${DOCKER_WORKDIR} FROM base as bun-base RUN apk update && apk add --no-cache curl tar bash -RUN curl -fsSL https://bun.sh/install | bash +COPY .bun-version .bun-version +RUN BUN_VERSION=$(cat .bun-version) && \ + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" # Add bun's global bin directory to PATH ENV PATH="/root/.bun/bin:${PATH}" From 712f1d0c895de33cfd390cfe6a66a2eb3808f0ad Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 22 Oct 2025 10:21:46 +0200 Subject: [PATCH 2/5] try to fix deploy --- deployment/bare_metal/install-missing-deps.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deployment/bare_metal/install-missing-deps.sh b/deployment/bare_metal/install-missing-deps.sh index 5e538c6ae..56ecc8d7c 100644 --- a/deployment/bare_metal/install-missing-deps.sh +++ b/deployment/bare_metal/install-missing-deps.sh @@ -1,5 +1,13 @@ #!/bin/bash +SCRIPT_PATH=$(realpath $0) +SCRIPT_DIR=$(dirname $SCRIPT_PATH) +PROJECT_ROOT=$SCRIPT_DIR/../.. + +echo "Project root: $PROJECT_ROOT" +echo "Script dir: $SCRIPT_DIR" +echo "Script path: $SCRIPT_PATH" + # Ensure required tools are installed # make sure correct node version is installed @@ -28,7 +36,7 @@ fi # check for some tools and install them, when missing # bun https://bun.com/install, faster packet-manager as yarn -BUN_VERSION_FILE="$(dirname "$0")/../../.bun-version" +BUN_VERSION_FILE="$PROJECT_ROOT/.bun-version" if [ ! -f "$BUN_VERSION_FILE" ]; then echo ".bun-version file not found at: $BUN_VERSION_FILE" exit 1 From 264d2697d1da69bb36da041a992664b1ef4eee02 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 22 Oct 2025 10:24:38 +0200 Subject: [PATCH 3/5] fix deploy --- deployment/bare_metal/install-missing-deps.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/deployment/bare_metal/install-missing-deps.sh b/deployment/bare_metal/install-missing-deps.sh index 56ecc8d7c..d311f60b6 100644 --- a/deployment/bare_metal/install-missing-deps.sh +++ b/deployment/bare_metal/install-missing-deps.sh @@ -4,10 +4,6 @@ SCRIPT_PATH=$(realpath $0) SCRIPT_DIR=$(dirname $SCRIPT_PATH) PROJECT_ROOT=$SCRIPT_DIR/../.. -echo "Project root: $PROJECT_ROOT" -echo "Script dir: $SCRIPT_DIR" -echo "Script path: $SCRIPT_PATH" - # Ensure required tools are installed # make sure correct node version is installed @@ -36,7 +32,7 @@ fi # check for some tools and install them, when missing # bun https://bun.com/install, faster packet-manager as yarn -BUN_VERSION_FILE="$PROJECT_ROOT/.bun-version" +BUN_VERSION_FILE="$SCRIPT_DIR/.bun-version" if [ ! -f "$BUN_VERSION_FILE" ]; then echo ".bun-version file not found at: $BUN_VERSION_FILE" exit 1 From 77f02e33e16724d58907c995b69d43ddae24a230 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 22 Oct 2025 10:27:37 +0200 Subject: [PATCH 4/5] really fix --- deployment/bare_metal/install-missing-deps.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/deployment/bare_metal/install-missing-deps.sh b/deployment/bare_metal/install-missing-deps.sh index d311f60b6..62ff353a4 100644 --- a/deployment/bare_metal/install-missing-deps.sh +++ b/deployment/bare_metal/install-missing-deps.sh @@ -1,9 +1,5 @@ #!/bin/bash -SCRIPT_PATH=$(realpath $0) -SCRIPT_DIR=$(dirname $SCRIPT_PATH) -PROJECT_ROOT=$SCRIPT_DIR/../.. - # Ensure required tools are installed # make sure correct node version is installed From 66975d295e5355d1a2a9e802e6efdff8a7bdb98c Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 22 Oct 2025 10:28:34 +0200 Subject: [PATCH 5/5] maybe now... --- deployment/bare_metal/install-missing-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/bare_metal/install-missing-deps.sh b/deployment/bare_metal/install-missing-deps.sh index 62ff353a4..a75a574dc 100644 --- a/deployment/bare_metal/install-missing-deps.sh +++ b/deployment/bare_metal/install-missing-deps.sh @@ -28,7 +28,7 @@ fi # check for some tools and install them, when missing # bun https://bun.com/install, faster packet-manager as yarn -BUN_VERSION_FILE="$SCRIPT_DIR/.bun-version" +BUN_VERSION_FILE="$PROJECT_ROOT/.bun-version" if [ ! -f "$BUN_VERSION_FILE" ]; then echo ".bun-version file not found at: $BUN_VERSION_FILE" exit 1