Skip to content

Commit

Permalink
Merge pull request #29 from stefmolin/docker-setup
Browse files Browse the repository at this point in the history
Add Docker setup option
  • Loading branch information
stefmolin authored Aug 10, 2024
2 parents 1c7e183 + 1b51495 commit d45e29b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM continuumio/miniconda3

WORKDIR /workshop

RUN /opt/conda/bin/conda install jupyter

COPY environment.yml .
RUN /opt/conda/bin/conda env create --file environment.yml

COPY . .

# Run within the container and allow access without token from localhost:8888
CMD [ "conda", "run", "-n", "pandas_workshop", "jupyter", "lab", \
"--allow-root", "--ip=0.0.0.0", "--no-browser", "--NotebookApp.token=''" ]
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ You should have basic knowledge of Python and be comfortable working in Jupyter
---

## Setup Instructions
You can work through the notebooks locally or in your browser. Pick the installation option that makes sense for you.

Pick the installation option that makes sense for you:

- [Local Installation](#local-installation)
- [Docker Container](#docker-installation)
- [Cloud Service](#cloud-options)

### Local Installation
**Warning**: It is highly recommended that you use your personal laptop for the installation.
Expand Down Expand Up @@ -89,6 +94,48 @@ You can work through the notebooks locally or in your browser. Pick the installa

![check env](./media/env_check.png)

### Docker Installation

0. Install the following, if not already installed:
- [Docker](https://docs.docker.com/get-docker/)
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

1. Fork this repository:

![location of fork button in GitHub](./media/fork_button.png)

2. Navigate to your fork, and click the **Code** button:

![location of code button in GitHub](./media/code_button.png)

3. Clone your forked repository using the desired method from the **Local** tab:

<img width="400px" src="./media/clone_options.png" alt="local cloning options">

4. Build the Docker image needed to run the Jupyter environment:

```shell
$ cd pandas-workshop
~/pandas-workshop$ docker compose build
```

5. Launch JupyterLab from within a Docker container:

```shell
~/pandas-workshop$ docker compose up
```

You should be able to access the environment at <http://localhost:8888>

6. Navigate to the `0-check_your_env.ipynb` notebook in the `notebooks/` folder:

![open 0-check_your_env.ipynb](./media/open_env_check_notebook.png)

7. Run the notebook to confirm everything is set up properly:

![check env](./media/env_check.png)

*Note: Once you're done, use `ctrl+c` to stop the Docker container.*
### Cloud Options
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
workshop:
build: .
ports:
- "8888:8888"
volumes:
- .:/workshop

0 comments on commit d45e29b

Please sign in to comment.