Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dockerfile #1817

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
.env
.git

26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM continuumio/miniconda3:latest

WORKDIR /qlib

COPY . .

RUN apt-get update && \
apt-get install -y build-essential

RUN conda create --name qlib_source python=3.8
RUN echo "conda activate qlib_source" >> ~/.bashrc
ENV PATH /opt/conda/envs/qlib_source/bin:$PATH

RUN python -m pip install --upgrade pip

RUN python -m pip install numpy==1.23.5
RUN python -m pip install pandas==1.5.3
RUN python -m pip install importlib-metadata==5.2.0
RUN python -m pip install "cloudpickle<3"
RUN python -m pip install scikit-learn==1.3.2

RUN pip install cython packaging tables matplotlib statsmodels

RUN python setup.py install
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cloning latest code is nightly.
We should distinguish stable version and nightly verion.


EXPOSE 10050
13 changes: 13 additions & 0 deletions build_docker_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this in the README or docs.


# Build the Docker image
sudo docker build -t qlib_image -f ./Dockerfile .

# Log in to Docker Hub
sudo docker login

# Tag the Docker image
sudo docker tag qlib_image linlanglv/qlib_image:stable

# Push the Docker image to Docker Hub
sudo docker push linlanglv/qlib_image:stable
Loading