Skip to content

Commit

Permalink
fix docker bug and add docker usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rcpeene committed Nov 20, 2024
1 parent a24bccb commit 5660323
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ RUN apt-get install -y libglib2.0-0
RUN apt-get install -y python3 python3-pip
RUN apt-get install -y git

RUN git config --global --add safe.directory /__w/openscope_databook/openscope_databook

# copy databook setup files
COPY requirements.txt ./openscope_databook/requirements.txt
COPY setup.py ./openscope_databook/setup.py
Expand Down
20 changes: 19 additions & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ You can download an individual notebook by pressing the `Download` button in the
```
pip install -e .
```
It is recommended that this is done within a conda environment using Python 3.10 to minimize any interference with local machine environments. For information on installing and using conda, go [here](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html). *Before* running the pip installation above, you can create a conda environment in the conda prompt with the command

#### Locally (Conda)
It is recommended that this is done within a conda environment using Python 3.10 or Docker to minimize any interference with local machine environments. For information on installing and using conda, go [here](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html). *Before* running the pip installation above, you can create a conda environment in the conda prompt with the command
```
conda create -n databook_env python=3.10
```
Expand All @@ -106,6 +108,22 @@ and you can run that environment with
conda activate databook_env
```


#### Locally (Docker)
The Databook also includes a dockerfile. If you want to build a docker container for the Databook yourself (for some reason), you can do so by running the following command in the Databook main directory after you have docker installed and running
```
docker build -t openscope_databook
```
You can then activate the docker by running the following command. Note that, to access the databook in your host machine's web browser, the port 8888 should be mapped to the docker container's port.
```
docker run -p 8888:8888 openscope_databook
```
Instead of building the container yourself, you can use the main docker container that we maintain, registered publically on Docker hub with the following command
```
docker run -p 8888:8888 rcpeene/openscope_databook:latest
```

#### Locally (Running Notebook)
Once you environment is setup, you can execute the notebooks in Jupyter by running the following command within the repo directory;
```
Jupyter notebook
Expand Down

0 comments on commit 5660323

Please sign in to comment.