Skip to content

Instantly share code, notes, and snippets.

@miohtama
Created October 3, 2024 10:31
Show Gist options
  • Save miohtama/8304936c10e2bedd157eab7bd87f6873 to your computer and use it in GitHub Desktop.
Save miohtama/8304936c10e2bedd157eab7bd87f6873 to your computer and use it in GitHub Desktop.
Datalore agent Dockerfile w/Talib installed
FROM jetbrains/datalore-agent:2024.1
USER root
ENV DEBIAN_FRONTEND noninteractive
# add deadsnakes ppa and install python 3.11
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && \
apt-get install -y python3.11 python3.11-venv python3.11-dev && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
# replace default minimal env with python 3.11
RUN rm -rf /opt/python/envs/minimal
RUN /usr/bin/python3.11 -m venv /opt/python/envs/minimal
# install TA-lib
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
RUN tar -xzf ta-lib-0.4.0-src.tar.gz
RUN cd ta-lib/ && \
./configure --prefix=/usr && \
make && \
make install
# install trade-executor
ARG TRADE_EXECUTOR_VERSION
RUN /opt/python/envs/minimal/bin/python -m pip install --upgrade pip
RUN /opt/python/envs/minimal/bin/pip install trade-executor[trendsspotter,execution,quantstats]@git+https://github.com/tradingstrategy-ai/trade-executor.git@$TRADE_EXECUTOR_VERSION
RUN /opt/python/envs/minimal/bin/pip install ta-lib==0.4.31
# rebuild indexes
USER datalore
COPY apikey.json /home/datalore/.tradingstrategy/settings.json
RUN ls -la /opt/datalore/agent/helpers && \
echo "Check /opt/datalore/agent/helpers permission."
RUN /opt/datalore/build_code_insight_data.sh /opt/python/envs/minimal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment