Skip to content
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

Local docker environment setup #30

Merged
merged 6 commits into from
Jul 27, 2024
Merged
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
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