feat: improve and upgrade build

use nodejs v14
allow build args to pass repo and branch
This commit is contained in:
Revant Nandgaonkar
2021-05-21 14:30:55 +05:30
parent 072375fe07
commit c6da8a1d98
9 changed files with 145 additions and 66 deletions

View File

@@ -3,11 +3,12 @@ FROM python:3.7-slim-buster
# Add non root user without password
RUN useradd -ms /bin/bash frappe
ARG GIT_REPO=https://github.com/frappe/frappe
ARG GIT_BRANCH=develop
ARG ARCH=amd64
ENV PYTHONUNBUFFERED 1
ENV NVM_DIR=/home/frappe/.nvm
ENV NODE_VERSION=12.20.0
ENV NODE_VERSION=14.17.0
ENV PATH="/home/frappe/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
# Install dependencies
@@ -44,7 +45,7 @@ RUN apt-get update -y && apt-get install \
&& if [ `uname -m` = 'x86_64' ]; then export ARCH=amd64; fi \
&& wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_${ARCH}.deb \
&& dpkg -i wkhtmltox_0.12.6-1.buster_${ARCH}.deb && rm wkhtmltox_0.12.6-1.buster_${ARCH}.deb \
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh \
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh \
&& chown -R frappe:frappe /home/frappe
# Setup docker-entrypoint
@@ -68,7 +69,7 @@ RUN python -m venv env \
&& pip3 install --upgrade pip \
&& pip3 install gevent \
&& cd apps \
&& git clone --depth 1 -o upstream https://github.com/frappe/frappe --branch ${GIT_BRANCH} \
&& git clone --depth 1 -o upstream ${GIT_REPO} --branch ${GIT_BRANCH} \
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/frappe
# Copy scripts and templates