Skip to content

Commit 2f6909f

Browse files
authored
Add local docker environment setup option (#30)
1 parent 7296bfc commit 2f6909f

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM continuumio/miniconda3
2+
3+
WORKDIR /workshop
4+
5+
RUN /opt/conda/bin/conda install jupyter
6+
7+
COPY environment.yml .
8+
RUN /opt/conda/bin/conda env create --file environment.yml
9+
10+
COPY . .
11+
12+
# Run within the container and allow access without token from localhost:8888
13+
CMD [ "conda", "run", "-n", "data_viz_workshop", "jupyter", "lab", \
14+
"--allow-root", "--ip=0.0.0.0", "--no-browser", "--NotebookApp.token=''" ]

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,48 @@ You can work through the notebooks locally or in your browser. Pick the installa
8080

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

83+
### Docker Installation
84+
0. Install the following, if not already installed:
85+
- [Docker](https://docs.docker.com/get-docker/)
86+
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
87+
88+
1. Fork this repository:
89+
90+
![location of fork button in GitHub](./media/fork_button.png)
91+
92+
2. Navigate to your fork, and click the **Code** button:
93+
94+
![location of code button in GitHub](./media/code_button.png)
95+
96+
3. Clone your forked repository using the desired method from the **Local** tab:
97+
98+
<img width="400px" src="./media/clone_options.png" alt="local cloning options">
99+
100+
4. Build the Docker image needed to run the Jupyter environment:
101+
102+
```shell
103+
$ cd python-data-viz-workshop
104+
~/python-data-viz-workshop$ docker compose build
105+
```
106+
107+
5. Launch JupyterLab from within a Docker container:
108+
109+
```shell
110+
~/python-data-viz-workshop$ docker compose up
111+
```
112+
113+
You should be able to access the environment at <http://localhost:8888>
114+
115+
6. Navigate to the `0-check_your_env.ipynb` notebook in the `notebooks/` folder:
116+
117+
![open 0-check_your_env.ipynb](./media/open_env_check_notebook.png)
118+
119+
7. Run the notebook to confirm everything is set up properly:
120+
121+
![check env](./media/env_check.png)
122+
123+
*Note: Once you're done, use `ctrl+c` to stop the Docker container.*
124+
83125
### Cloud Options
84126
85127
#### GitHub Codespaces

docker-compose.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
workshop:
3+
build: .
4+
ports:
5+
- "8888:8888"
6+
volumes:
7+
- .:/workshop

0 commit comments

Comments
 (0)