Skip to content

Commit 7b39d0c

Browse files
committed
ADD: docker files to run project in a container
Signed-off-by: hrezaei <[email protected]>
1 parent 5be3cea commit 7b39d0c

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ properties of both neural nets (learning) and symbolic logic (knowledge and reas
2020
knowledge.
2121

2222
## Quickstart
23+
You can install the LNN locally on your machine or inside a container.
24+
### Install on Local Machine
2325
To install the LNN:
2426
1. Install [GraphViz](https://www.graphviz.org/download/) and gmp (libgmp3-dev)
2527
<details>
@@ -76,7 +78,22 @@ To install the LNN:
7678
```commandline
7779
pip install git+https://github.com/IBM/LNN.git
7880
```
81+
### Run in Container
82+
Download or clone the repository using the command below:
83+
```commandline
84+
git clone https://github.com/IBM/LNN.git
85+
```
86+
87+
and then run
88+
```commandline
89+
cd docker && docker-compose up
90+
```
7991

92+
Then open the address below in your browser:
93+
```
94+
http://localhost:8888/
95+
```
96+
This should open the Jupyter Notebook UI with all environment ready to work with LNN.
8097
## Contribution
8198
Contributions to the LNN codebase are welcome!
8299

docker/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM python:3.9.10-slim-buster
2+
3+
WORKDIR /home/LNN
4+
5+
RUN apt-get update && apt-get install --assume-yes gcc wget python3-dev git graphviz graphviz-dev libgraphviz-dev pkg-config libgmp-dev
6+
RUN /usr/local/bin/python -m pip install --upgrade pip
7+
8+
EXPOSE 8888
9+
10+
CMD ["./docker/docker-entrypoint.sh"]

docker/docker-compose.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '3.3'
2+
3+
services:
4+
ibm_lnn:
5+
container_name: ibm_lnn
6+
build:
7+
context: ../
8+
dockerfile: docker/Dockerfile
9+
ports:
10+
- "8888:8888"
11+
volumes:
12+
- ../:/home/LNN
13+
14+
15+
16+
17+

docker/docker-entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
pip install .
4+
5+
jupyter notebook --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password=''

0 commit comments

Comments
 (0)