2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-12-23 02:28:57 +00:00

fix: install node and python envs for v13 (#963)

fixes #962
This commit is contained in:
Revant Nandgaonkar 2022-10-16 13:38:16 +05:30 committed by GitHub
parent 6bfd1f926e
commit ba68887e40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View File

@ -68,17 +68,23 @@ bench init --skip-redis-config-generation frappe-bench
cd frappe-bench
```
For version 13 use Python 3.9 by passing option to `bench init` command,
To setup frappe framework version 14 bench set `PYENV_VERSION` environment variable to `3.10.5` (default) and use NodeJS version 14 (default),
```shell
bench init --skip-redis-config-generation --frappe-branch version-13 --python python3.9 frappe-bench
# Use default environments
bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench
# Or set environment versions explicitly
nvm use v16
PYENV_VERSION=3.10.5 bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench
# Switch directory
cd frappe-bench
```
For version 12 use Python 3.7 by passing option to `bench init` command,
To setup frappe framework version 13 bench set `PYENV_VERSION` environment variable to `3.9.9` and use NodeJS version 14,
```shell
bench init --skip-redis-config-generation --frappe-branch version-12 --python python3.7 frappe-bench
nvm use v14
PYENV_VERSION=3.9.9 bench init --skip-redis-config-generation --frappe-branch version-13 frappe-bench
cd frappe-bench
```

View File

@ -98,6 +98,8 @@ ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN git clone --depth 1 https://github.com/pyenv/pyenv.git .pyenv \
&& pyenv install $PYTHON_VERSION_V13 \
&& pyenv install $PYTHON_VERSION \
&& PYENV_VERSION=$PYTHON_VERSION_V13 pip install virtualenv \
&& PYENV_VERSION=$PYTHON_VERSION pip install virtualenv \
&& pyenv global $PYTHON_VERSION $PYTHON_VERSION_v13 \
&& sed -Ei -e '/^([^#]|$)/ {a export PYENV_ROOT="/home/frappe/.pyenv" a export PATH="$PYENV_ROOT/bin:$PATH" a ' -e ':a' -e '$!{n;ba};}' ~/.profile \
&& echo 'eval "$(pyenv init --path)"' >>~/.profile \
@ -114,12 +116,15 @@ RUN git clone ${GIT_REPO} --depth 1 -b ${GIT_BRANCH} .bench \
&& echo "export BENCH_DEVELOPER=1" >>/home/frappe/.bashrc
# Install Node via nvm
ENV NODE_VERSION=14.18.1
ENV NODE_VERSION_14=14.19.3
ENV NODE_VERSION=16.18.0
ENV NVM_DIR /home/frappe/.nvm
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh \
&& nvm install ${NODE_VERSION_14} \
&& nvm use v${NODE_VERSION_14} \
&& npm install -g yarn \
&& nvm install ${NODE_VERSION} \
&& nvm use v${NODE_VERSION} \