docker for ci test

This commit is contained in:
julesGoullee
2021-01-10 19:28:27 +04:00
parent 49a1ac4671
commit 8777ed36f6
4 changed files with 68 additions and 0 deletions

23
.dockerignore Normal file
View File

@@ -0,0 +1,23 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
env
pip-log.txt
pip-delete-this-directory.txt
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
*.log
.git
*.md
!README*.md
README-secret.md
.drone.yml
Dockerfile
docker-compose.yml

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
FROM python:3.9.0
ENV PYTHONUNBUFFERED 1
RUN apt-get update \
&& apt-get -y install build-essential libssl-dev \
&& apt-get clean \
&& pip install --upgrade pip
RUN pip3 install Cython numpy
# Prepare environment
RUN mkdir /jesse-docker
WORKDIR /jesse-docker
# Install TA-lib
COPY docker_build_helpers/* /tmp/
RUN cd /tmp && /tmp/install_ta-lib.sh && rm -r /tmp/*ta-lib*
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
COPY . /jesse-docker
# Install dependencies
RUN pip3 install -e .
# Build
RUN python setup.py bdist_wheel
ENTRYPOINT pytest

View File

@@ -0,0 +1,17 @@
if [ -z "$1" ]; then
INSTALL_LOC=/usr/local
else
INSTALL_LOC=${1}
fi
echo "Installing to ${INSTALL_LOC}"
if [ ! -f "${INSTALL_LOC}/lib/libta_lib.a" ]; then
tar zxvf ta-lib-0.4.0-src.tar.gz
cd ta-lib \
&& sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h \
&& ./configure --prefix=${INSTALL_LOC}/ \
&& make \
&& which sudo && sudo make install || make install \
&& echo "export LD_LIBRARY_PATH=/usr/local/lib" >> /root/.bashrc
else
echo "TA-lib already installed, skipping installation"
fi

Binary file not shown.