diff --git a/README.md b/README.md index 14d1b59..2e96e4e 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,20 @@ docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/wo ``` In your web browser, go to the URL shown in the output. + +Or if you want to cache installation of python depenencies, +you can build docker image once with dependencies installed: + +``` +cd notebooks +make build # will use Makefile "build" target +``` + +and keep using it: + +``` +cd notebooks +make run # will use Makefile's "run" target +``` + +In your web browser, go to the URL shown in the output. diff --git a/notebooks/Dockerfile b/notebooks/Dockerfile new file mode 100644 index 0000000..62f4405 --- /dev/null +++ b/notebooks/Dockerfile @@ -0,0 +1,8 @@ +FROM jupyter/datascience-notebook:python-3.9 + +# Install langchain[llms] and python-dotenv +RUN pip install langchain[llms] \ + && pip install python-dotenv + +# Set the working directory +WORKDIR /home/jovyan/work diff --git a/notebooks/Makefile b/notebooks/Makefile new file mode 100644 index 0000000..a70d402 --- /dev/null +++ b/notebooks/Makefile @@ -0,0 +1,8 @@ +.PHONY: build run + +build: + docker build -t cristobalcl_img . + +run: + docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v "$$PWD":/home/jovyan/work cristobalcl_img +