Skip to content

Commit

Permalink
Add local docker environment setup option (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpvanegasc authored Jul 27, 2024
1 parent 7296bfc commit 2f6909f
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
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", "data_viz_workshop", "jupyter", "lab", \
"--allow-root", "--ip=0.0.0.0", "--no-browser", "--NotebookApp.token=''" ]
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,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 python-data-viz-workshop
~/python-data-viz-workshop$ docker compose build
```

5. Launch JupyterLab from within a Docker container:

```shell
~/python-data-viz-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
#### GitHub Codespaces
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 2f6909f

Please sign in to comment.