Skip to content

Commit

Permalink
ADD: docker files to run project in a container
Browse files Browse the repository at this point in the history
Signed-off-by: hrezaei <[email protected]>
  • Loading branch information
HRezaei committed Mar 3, 2023
1 parent 2382067 commit 510e0df
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ properties of both neural nets (learning) and symbolic logic (knowledge and reas
knowledge.

## Quickstart
You can install the LNN locally on your machine or inside a container.
### Install on Local Machine
To install the LNN:

1. Make sure that the python version you use in line with our [setup](https://github.com/IBM/LNN/blob/master/setup.py) file, using a fresh environment is always a good idea:
Expand All @@ -32,7 +34,22 @@ To install the LNN:
```commandline
pip install git+https://github.com/IBM/LNN
```
### Run in Container
Download or clone the repository using the command below:
```commandline
git clone https://github.com/IBM/LNN.git
```

and then run
```commandline
cd docker && docker-compose up
```

Then open the address below in your browser:
```
http://localhost:8888/
```
This should open the Jupyter Notebook UI with all environment ready to work with LNN.
## Contribution
Contributions to the LNN codebase are welcome!

Expand Down
10 changes: 10 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.9.10-slim-buster

WORKDIR /home/LNN

RUN apt-get update && apt-get install --assume-yes gcc wget python3-dev git graphviz graphviz-dev libgraphviz-dev pkg-config libgmp-dev
RUN /usr/local/bin/python -m pip install --upgrade pip

EXPOSE 8888

CMD ["./docker/docker-entrypoint.sh"]
17 changes: 17 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.3'

services:
ibm_lnn:
container_name: ibm_lnn
build:
context: ../
dockerfile: docker/Dockerfile
ports:
- "8888:8888"
volumes:
- ../:/home/LNN





5 changes: 5 additions & 0 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

pip install .

jupyter notebook --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password=''

0 comments on commit 510e0df

Please sign in to comment.