Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
119 lines (104 sloc) 4.67 KB
#
# LEAN Foundation Docker Container 20190710
# Cross platform deployment for multiple brokerages
# Intended to be used in conjunction with Dockerfile. This is just the foundation common OS+Dependencies required.
#
# Use base system for cleaning up wayward processes
FROM phusion/baseimage:0.9.22
MAINTAINER QuantConnect <contact@quantconnect.com>
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Have to add env TZ=UTC. See https://github.com/dotnet/coreclr/issues/602
RUN env TZ=UTC
# Install OS Packages:
# Misc tools for running Python.NET and IB inside a headless container.
RUN apt-get update && apt-get install -y git bzip2 unzip wget python3-pip python-opengl zlib1g-dev && \
apt-get install -y clang cmake curl xvfb libxrender1 libxtst6 libxi6 libglib2.0-dev libopenmpi-dev && \
# Install R
apt-get install -y r-base pandoc libcurl4-openssl-dev
# Java for running IB inside container:
RUN apt-get install -y openjdk-8-jdk openjdk-8-jre
# Install IB Gateway: Installs to ~/Jts
RUN wget http://cdn.quantconnect.com/interactive/ibgateway-latest-standalone-linux-x64-v974.4g.sh && \
chmod 777 ibgateway-latest-standalone-linux-x64-v974.4g.sh && \
./ibgateway-latest-standalone-linux-x64-v974.4g.sh -q && \
wget -O ~/Jts/jts.ini http://cdn.quantconnect.com/interactive/ibgateway-latest-standalone-linux-x64-v974.4g.jts.ini && \
rm ibgateway-latest-standalone-linux-x64-v974.4g.sh
# Mono C# for LEAN:
# From https://github.com/mono/docker/blob/master/
RUN apt-get update && rm -rf /var/lib/apt/lists/*
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb http://download.mono-project.com/repo/ubuntu stable-xenial/snapshots/5.12.0.226 main" > /etc/apt/sources.list.d/mono-xamarin.list && \
apt-get update && apt-get install -y binutils mono-complete ca-certificates-mono mono-vbnc nuget referenceassemblies-pcl && \
apt-get install -y fsharp && rm -rf /var/lib/apt/lists/* /tmp/*
# Install miniconda
ENV CONDA="Miniconda3-4.5.12-Linux-x86_64.sh"
ENV PATH="/opt/miniconda3/bin:${PATH}"
RUN wget https://cdn.quantconnect.com/miniconda/${CONDA} && \
bash ${CONDA} -b -p /opt/miniconda3 && rm -rf ${CONDA} && \
ln -s /opt/miniconda3/lib/libpython3.6m.so /usr/lib/libpython3.6m.so
# Install supported third party python packages
RUN conda update -y conda pip
RUN conda install -y python=3.6.8 \
blaze=0.11.3 \
cvxopt=1.2.0 \
cython=0.29.11 \
dill=0.2.9 \
jsonschema=3.0.1 \
keras=2.2.4 \
lxml=4.3.4 \
msgpack-python=0.5.6 \
nltk=3.4.3 \
numpy=1.16.1 \
pandas=0.23.4 \
pomegranate=0.10.0 \
wrapt=1.10.11 \
nltk=3.4.3 \
tensorflow=1.13.1
RUN conda install -y -c conda-forge \
fbprophet=0.5 \
rauth=0.7.3 \
setuptools-git>=1.2
RUN conda install -y -c pytorch \
pytorch=1.1.0 \
torchvision=0.3.0
RUN conda install -y -c fastai \
nvidia-ml-py3=7.352.0 \
fastai=1.0.54
RUN conda clean -y --all
RUN pip install --upgrade pip
RUN pip install gym==0.13.1 \
arch==4.8.1 \
beautifulsoup4==4.7.1 \
copulalib==1.1.0 \
copulas==0.2.1 \
cvxpy==1.0.24 \
deap==1.3.0 \
lightgbm==2.2.3 \
pykalman==0.9.5 \
pyramid-arima==0.9.0 \
pyro-ppl==0.3.3 \
QuantLib-Python==1.15 \
sklearn==0.0 \
stable-baselines==2.6.0 \
statistics==1.0.3.5 \
tensorforce==0.4.3 \
theano==1.0.4 \
tsfresh==0.12.0 \
xgboost==0.90
RUN pip install --upgrade --user hmmlearn==0.2.2
RUN python -c "import nltk; nltk.download('punkt')"
RUN conda clean -y --all
# Install TA-lib for python
RUN wget http://cdn.quantconnect.com/ta-lib/ta-lib-0.4.0-src.tar.gz && \
tar -zxvf ta-lib-0.4.0-src.tar.gz && cd ta-lib && \
./configure --prefix=/usr && make && make install && \
pip install TA-lib
# Install DX Analytics
RUN git clone https://github.com/yhilpisch/dx.git && cd dx && \
python setup.py install && cd .. && rm -irf dx
# Install py-earth
RUN git clone git://github.com/scikit-learn-contrib/py-earth.git && cd py-earth && \
python setup.py install && cd .. && rm -irf py-earth
# List all packages
RUN conda list
You can’t perform that action at this time.