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

Dockerfile is added to the codebase #79

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -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"]