Skip to content

Add docker files to run project in a container #67

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
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=''