Skip to content

Commit d45e29b

Browse files
authored
Merge pull request #29 from stefmolin/docker-setup
Add Docker setup option
2 parents 1c7e183 + 1b51495 commit d45e29b

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
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", "pandas_workshop", "jupyter", "lab", \
14+
"--allow-root", "--ip=0.0.0.0", "--no-browser", "--NotebookApp.token=''" ]

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ You should have basic knowledge of Python and be comfortable working in Jupyter
3535
---
3636

3737
## Setup Instructions
38-
You can work through the notebooks locally or in your browser. Pick the installation option that makes sense for you.
38+
39+
Pick the installation option that makes sense for you:
40+
41+
- [Local Installation](#local-installation)
42+
- [Docker Container](#docker-installation)
43+
- [Cloud Service](#cloud-options)
3944

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

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

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

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)