fix: install correct nodejs as per frappe version (#970)
fixes #967, #969
This commit is contained in:
parent
fcb52d218f
commit
8e7f8b3b71
@ -73,7 +73,8 @@ target "default-args" {
|
|||||||
BENCH_REPO = "${BENCH_REPO}"
|
BENCH_REPO = "${BENCH_REPO}"
|
||||||
FRAPPE_VERSION = "${FRAPPE_VERSION}"
|
FRAPPE_VERSION = "${FRAPPE_VERSION}"
|
||||||
ERPNEXT_VERSION = "${ERPNEXT_VERSION}"
|
ERPNEXT_VERSION = "${ERPNEXT_VERSION}"
|
||||||
PYTHON_VERSION = can(regex("v13", "${ERPNEXT_VERSION}")) ? "3.9" : "3.10"
|
PYTHON_VERSION = can(regex("v13", "${ERPNEXT_VERSION}")) ? "3.9.9" : "3.10.5"
|
||||||
|
NODE_VERSION = can(regex("v13", "${FRAPPE_VERSION}")) ? "14.19.3" : "16.18.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,11 @@ FROM frappe/bench:latest as assets_builder
|
|||||||
|
|
||||||
ARG FRAPPE_VERSION
|
ARG FRAPPE_VERSION
|
||||||
ARG FRAPPE_REPO=https://github.com/frappe/frappe
|
ARG FRAPPE_REPO=https://github.com/frappe/frappe
|
||||||
RUN bench init --version=${FRAPPE_VERSION} --frappe-path=${FRAPPE_REPO} --skip-redis-config-generation --verbose --skip-assets /home/frappe/frappe-bench
|
ARG PYTHON_VERSION
|
||||||
|
ARG NODE_VERSION
|
||||||
|
ENV NVM_DIR=/home/frappe/.nvm
|
||||||
|
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
|
||||||
|
RUN PYENV_VERSION=${PYTHON_VERSION} bench init --version=${FRAPPE_VERSION} --frappe-path=${FRAPPE_REPO} --skip-redis-config-generation --verbose --skip-assets /home/frappe/frappe-bench
|
||||||
|
|
||||||
WORKDIR /home/frappe/frappe-bench
|
WORKDIR /home/frappe/frappe-bench
|
||||||
|
|
||||||
|
@ -65,15 +65,27 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
|||||||
&& git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \
|
&& git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \
|
||||||
&& install-app erpnext
|
&& install-app erpnext
|
||||||
|
|
||||||
|
|
||||||
FROM base as configured_base
|
FROM base as configured_base
|
||||||
|
|
||||||
ARG WKHTMLTOPDF_VERSION=0.12.6-1
|
ARG WKHTMLTOPDF_VERSION=0.12.6-1
|
||||||
|
ARG NODE_VERSION
|
||||||
|
ENV NVM_DIR=/home/frappe/.nvm
|
||||||
|
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
# Setup Node lists
|
# Setup Node lists
|
||||||
&& apt-get install --no-install-recommends -y curl \
|
&& apt-get install --no-install-recommends -y curl \
|
||||||
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
|
# NodeJS with NVM
|
||||||
|
&& mkdir -p ${NVM_DIR} \
|
||||||
|
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \
|
||||||
|
&& . ${NVM_DIR}/nvm.sh \
|
||||||
|
&& nvm install ${NODE_VERSION} \
|
||||||
|
&& nvm use v${NODE_VERSION} \
|
||||||
|
&& npm install -g yarn \
|
||||||
|
&& nvm alias default v${NODE_VERSION} \
|
||||||
|
&& rm -rf ${NVM_DIR}/.cache \
|
||||||
|
&& echo 'export NVM_DIR="/home/frappe/.nvm"' >>~/.bashrc \
|
||||||
|
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
|
||||||
|
&& echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> ~/.bashrc \
|
||||||
# Install wkhtmltopdf with patched qt
|
# Install wkhtmltopdf with patched qt
|
||||||
&& if [ "$(uname -m)" = "aarch64" ]; then export ARCH=arm64; fi \
|
&& if [ "$(uname -m)" = "aarch64" ]; then export ARCH=arm64; fi \
|
||||||
&& if [ "$(uname -m)" = "x86_64" ]; then export ARCH=amd64; fi \
|
&& if [ "$(uname -m)" = "x86_64" ]; then export ARCH=amd64; fi \
|
||||||
@ -92,8 +104,7 @@ RUN apt-get update \
|
|||||||
# For healthcheck
|
# For healthcheck
|
||||||
wait-for-it \
|
wait-for-it \
|
||||||
jq \
|
jq \
|
||||||
# other
|
# Clean up
|
||||||
nodejs \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY pretend-bench.sh /usr/local/bin/bench
|
COPY pretend-bench.sh /usr/local/bin/bench
|
||||||
|
Loading…
x
Reference in New Issue
Block a user