6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 06:07:56 +00:00

Install python requirements in venv in docker image

Installing the requirements in a virtualenv is necessary to run "pip
install ..." commands in development mode, when the USERID is != 0.
This commit is contained in:
Régis Behmo 2019-03-09 17:51:25 +01:00
parent b7c31d770f
commit 3e5e494bd8
3 changed files with 10 additions and 6 deletions

View File

@ -2,6 +2,7 @@
## Latest
- [Improvement] Install python requirements in virtual env in docker image
- [Bugfix] Add missing volume for theme development
- [Improvement] Rename "config [non]interactive" command to "config save [--silent]"
- [Improvement] More explicit logging during environment generation

View File

@ -43,7 +43,7 @@ In order to run a fork of edx-platform, dependencies need to be properly install
export TUTOR_EDX_PLATFORM_PATH=/path/to/edx-platform
tutor dev run lms npm install
tutor dev run lms pip install --src ../venv/src --requirement requirements/edx/development.txt
tutor dev run lms pip install --requirement requirements/edx/development.txt
tutor dev run lms python setup.py install
tutor dev run lms openedx-assets build
@ -73,7 +73,7 @@ Watch the themes folders for changes (in a different terminal)::
tutor dev watchthemes
Make changes to some of the files inside your theme directory: the theme assets should be automatically recompiled and visible at http://localhost:8000.
Make changes to some of the files inside the theme directory: the theme assets should be automatically recompiled and visible at http://localhost:8000.
Assets management
-----------------

View File

@ -6,7 +6,7 @@ MAINTAINER Régis Behmo <regis@behmo.com>
# Install system requirements
RUN apt update && \
# Global requirements
apt install -y language-pack-en git python-virtualenv build-essential software-properties-common curl git-core libxml2-dev libxslt1-dev python-pip libmysqlclient-dev python-apt python-dev libxmlsec1-dev libfreetype6-dev swig gcc g++ \
apt install -y language-pack-en git python-virtualenv build-essential software-properties-common curl git-core libxml2-dev libxslt1-dev python-virtualenv libmysqlclient-dev python-apt python-dev libxmlsec1-dev libfreetype6-dev swig gcc g++ \
# openedx requirements
gettext gfortran graphviz graphviz-dev libffi-dev libfreetype6-dev libgeos-dev libjpeg8-dev liblapack-dev libpng12-dev libsqlite3-dev libxml2-dev libxmlsec1-dev libxslt1-dev lynx nodejs npm ntp pkg-config \
# Our requirements
@ -36,12 +36,15 @@ RUN cd /tmp \
# Install python requirements (clone source repos in a separate dir, otherwise
# they will be overwritten when we mount edx-platform)
ENV NO_PYTHON_UNINSTALL 1
RUN pip install --src ../venv/src -r requirements/edx/base.txt
RUN pip install --src ../venv/src -r requirements/edx/development.txt
RUN virtualenv /openedx/venv
ENV PATH /openedx/venv/bin:${PATH}
ENV VIRTUAL_ENV /openedx/venv/
RUN pip install setuptools==39.0.1 pip==9.0.3
RUN pip install -r requirements/edx/development.txt
# Install patched version of ora2
RUN pip uninstall -y ora2 && \
pip install --src ../venv/src git+https://github.com/regisb/edx-ora2.git@open-release/hawthorn.2#egg=ora2==2.1.17
pip install git+https://github.com/regisb/edx-ora2.git@open-release/hawthorn.2#egg=ora2==2.1.17
# Install a recent version of nodejs
RUN nodeenv /openedx/nodeenv --node=8.9.3 --prebuilt