Skip to content

Commit 510e0df

Browse files
committed
ADD: docker files to run project in a container
Signed-off-by: hrezaei <mr.hrezaei@gmail.com>
1 parent 2382067 commit 510e0df

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
@@ -21,6 +21,8 @@ properties of both neural nets (learning) and symbolic logic (knowledge and reas
2121
knowledge.
2222

2323
## Quickstart
24+
You can install the LNN locally on your machine or inside a container.
25+
### Install on Local Machine
2426
To install the LNN:
2527

2628
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:
@@ -32,7 +34,22 @@ To install the LNN:
3234
```commandline
3335
pip install git+https://github.com/IBM/LNN
3436
```
37+
### Run in Container
38+
Download or clone the repository using the command below:
39+
```commandline
40+
git clone https://github.com/IBM/LNN.git
41+
```
42+
43+
and then run
44+
```commandline
45+
cd docker && docker-compose up
46+
```
3547

48+
Then open the address below in your browser:
49+
```
50+
http://localhost:8888/
51+
```
52+
This should open the Jupyter Notebook UI with all environment ready to work with LNN.
3653
## Contribution
3754
Contributions to the LNN codebase are welcome!
3855

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)