From e694c823433b681cb49653200439ab2a0819af67 Mon Sep 17 00:00:00 2001 From: sabaimran <65192171+sabaimran@users.noreply.github.com> Date: Fri, 19 Jul 2024 06:41:29 -0700 Subject: [PATCH] Fix Docker build issues with yarn / next /node (#859) * Rollback node version being installed from nodesource to node 20 --- Dockerfile | 12 ++++++------ prod.Dockerfile | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index cdaf3c14..b3101b10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,12 +7,12 @@ LABEL org.opencontainers.image.source="https://github.com/khoj-ai/khoj" # Install System Dependencies RUN apt update -y && apt -y install python3-pip swig curl -# Install Node.js and Yarn using nvm in a single RUN instruction -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install 20 && \ - npm install --global yarn +# Install Node.js and Yarn +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - +RUN apt -y install nodejs +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list +RUN apt update && apt -y install yarn # Install RapidOCR dependencies RUN apt -y install libgl1 libgl1-mesa-glx libglib2.0-0 diff --git a/prod.Dockerfile b/prod.Dockerfile index 820593c7..d42f8779 100644 --- a/prod.Dockerfile +++ b/prod.Dockerfile @@ -5,12 +5,12 @@ LABEL org.opencontainers.image.source="https://github.com/khoj-ai/khoj" # Install System Dependencies RUN apt update -y && apt -y install python3-pip libsqlite3-0 ffmpeg libsm6 libxext6 swig curl -# Install Node.js and Yarn using nvm in a single RUN instruction -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install 20 && \ - npm install --global yarn +# Install Node.js and Yarn +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - +RUN apt -y install nodejs +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list +RUN apt update && apt -y install yarn WORKDIR /app