diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..d9e8b55 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,21 @@ +# Running Docker Container for Jupyter Notebooks + +### Build Docker Container + +```bash + sudo docker docker-compose -f docker-compose.yml build +``` + +### Run Docker Container + +```bash + sudo docker-compose -f docker-compose.yml up +``` + +### Open Jupyter Notebooks in Browser +Grab the URL from the output of the previous up command + +Example: +```bash + http://127.0.0.1:8888/?token=154a634851c1a1754e1e37a6d2466a289325af6986b1d868 +``` diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..82a63c3 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3' + +services: + grokking-ml46: + build: ./jupyter + container_name: grokking-ml46 + ports: + - "8888:8888" diff --git a/docker/jupyter/Dockerfile b/docker/jupyter/Dockerfile new file mode 100644 index 0000000..c3f1c29 --- /dev/null +++ b/docker/jupyter/Dockerfile @@ -0,0 +1,28 @@ +FROM continuumio/miniconda3:4.9.2 + +RUN apt-get --allow-releaseinfo-change-suite update && apt-get install -y \ + unzip \ + git \ + python3-pip \ + python3-numpy \ + python3-scipy \ + python3-pandas \ + && apt clean + +WORKDIR /opt/conda +RUN /opt/conda/bin/conda install jupyter -y --quiet \ + && /opt/conda/bin/conda install pydotplus -y --quiet \ + && /opt/conda/bin/conda install tensorflow -y --quiet \ + && mkdir /opt/notebooks + +RUN pip install -U pip + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +WORKDIR /opt/notebooks + +RUN git clone https://github.com/luisguiserrano/manning.git +RUN cp -R manning/Chapter_* . +RUN rm -rf manning +CMD ["/opt/conda/bin/jupyter", "notebook", "--notebook-dir=/opt/notebooks", "--ip=*", "--port=8888", "--no-browser", "--allow-root"] diff --git a/docker/jupyter/requirements.txt b/docker/jupyter/requirements.txt new file mode 100644 index 0000000..0ede186 --- /dev/null +++ b/docker/jupyter/requirements.txt @@ -0,0 +1,11 @@ +numpy +pandas +matplotlib +turicreate +jupyter +jupyterlab +jupyterlab-server +Keras-Preprocessing +scikit-image +scikit-learn +tensorflow