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
  • Loading branch information
HRezaei committed Jan 29, 2023
1 parent 5be3cea commit 99213d9
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 @@ -20,6 +20,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. Install [GraphViz](https://www.graphviz.org/download/) and gmp (libgmp3-dev)
<details>
Expand Down Expand Up @@ -76,7 +78,22 @@ To install the LNN:
```commandline
pip install git+https://github.com/IBM/LNN.git
```
### 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 99213d9

Please sign in to comment.