diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d0d52aa --- /dev/null +++ b/Dockerfile @@ -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=''" ] diff --git a/README.md b/README.md index ca4f342..7f867e1 100644 --- a/README.md +++ b/README.md @@ -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: + + 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 + +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 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..426d0ed --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,7 @@ +services: + workshop: + build: . + ports: + - "8888:8888" + volumes: + - .:/workshop