diff --git a/README.md b/README.md index 9d0e5c03..59e73263 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,27 @@ pip3 install -i https://pypi.gurobi.com gurobipy Then, you will need a [license](https://www.gurobi.com/downloads/end-user-license-agreement-academic/). For more information, we refer to the Gurobi [download center](https://www.gurobi.com/downloads/). +## Running the Application with Docker +1. **Build the Docker Image** + + Open a terminal in the directory containing the Dockerfile and build the Docker image using the following command: + ````bash + docker build -t my_dingo_app . + ```` + + Replace `my_dingo_app` with the name you want to give to your Docker image. + +2. **Run the Docker Container** + + After the image has been built, you can run a container from it using the following command: + ````bash + docker run -it my_dingo_app + ```` + + The `-it` option is used to run the Docker container in interactive mode. + +Please note that Docker must be installed on your system to build and run Docker images and containers. You can download Docker from [here](https://www.docker.com/products/docker-desktop). ## Unit tests diff --git a/dockerfile b/dockerfile new file mode 100644 index 00000000..edf9bc5b --- /dev/null +++ b/dockerfile @@ -0,0 +1,40 @@ +# Use the Gurobi Docker image as a base +FROM gurobi/python + +# Install any additional dependencies for dingo +RUN apt-get update && apt-get install -y \ + cmake \ + lp-solve \ + git \ + wget \ + vim \ + bzip2 \ + g++ \ + && rm -rf /var/lib/apt/lists/* + +# Install dependencies +RUN apt-get update && apt-get install -y libsuitesparse-dev +RUN pip install sparseqr \ + Cython \ + cobra \ + kaleido + +WORKDIR /app + +# Get dingo +RUN git clone https://github.com/GeomScale/dingo.git && \ + cd dingo && \ + git submodule update --init + +# Get boost library +WORKDIR /app/dingo +RUN wget -O boost_1_76_0.tar.bz2 https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 && \ + tar xjf boost_1_76_0.tar.bz2 && \ + rm boost_1_76_0.tar.bz2 + +# Get PySQR +RUN apt-get install libsuitesparse-dev + +# Install dingo +RUN pip install matplotlib plotly +RUN ["python", "setup.py", "install", "--user"] \ No newline at end of file