fix: add nodejs via nvm
This commit is contained in:
@@ -4,6 +4,9 @@ RUN useradd -ms /bin/bash frappe
|
||||
|
||||
ARG GIT_BRANCH=develop
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV NVM_DIR=/home/frappe/.nvm
|
||||
ENV NODE_VERSION=14.7.0
|
||||
ENV PATH="/home/frappe/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
|
||||
|
||||
# Install dependencies
|
||||
WORKDIR /home/frappe/frappe-bench
|
||||
@@ -27,7 +30,17 @@ RUN install_packages \
|
||||
libpq-dev \
|
||||
&& wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb \
|
||||
&& dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb \
|
||||
&& apt-get purge -y wget && apt-get autoremove -y
|
||||
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh \
|
||||
&& apt-get purge -y wget && apt-get autoremove -y \
|
||||
&& chown -R frappe:frappe /home/frappe
|
||||
|
||||
USER frappe
|
||||
# Install nvm with node
|
||||
RUN bash install.sh \
|
||||
&& . "$NVM_DIR/nvm.sh" \
|
||||
&& nvm install ${NODE_VERSION} \
|
||||
&& nvm use v${NODE_VERSION} \
|
||||
&& nvm alias default v${NODE_VERSION}
|
||||
|
||||
# Create frappe-bench directories
|
||||
RUN mkdir -p apps logs commands /home/frappe/backups
|
||||
@@ -39,6 +52,7 @@ RUN python -m venv env \
|
||||
&& git clone --depth 1 -o upstream https://github.com/frappe/frappe --branch ${GIT_BRANCH} \
|
||||
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/frappe
|
||||
|
||||
USER root
|
||||
# Copy scripts and templates
|
||||
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
|
||||
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
|
||||
@@ -52,7 +66,7 @@ RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
|
||||
WORKDIR /home/frappe/frappe-bench/sites
|
||||
|
||||
# Set ownership of sites directory
|
||||
RUN chown -R frappe:frappe /home/frappe/frappe-bench/sites /home/frappe/backups
|
||||
RUN chown -R frappe:frappe /home/frappe/frappe-bench/sites
|
||||
|
||||
VOLUME [ "/home/frappe/frappe-bench/sites", "/home/frappe/backups" ]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user