benman1 / generative_ai_with_langchain

Build large language model (LLM) apps with Python, ChatGPT and other models. This is the companion repository for the book on generative AI with LangChain.
https://amzn.to/43PuIkQ
MIT License
552 stars 219 forks source link

When I run docker run -it new_image, without any reponse #8

Closed scq000 closed 6 months ago

scq000 commented 7 months ago
image

And when I open http://localhost:8080, it also cannot be access.

danrosher commented 7 months ago

This worked for me, alter Dockerfile to be

FROM continuumio/miniconda3:latest
RUN apt-get update && apt-get install build-essential python3-dev -y
COPY langchain_ai.yaml /langchain_ai.yaml
COPY notebooks /notebooks
RUN conda env update -n base -f /langchain_ai.yaml && conda clean -afy
EXPOSE 8888
ENTRYPOINT ["conda", "run", "-n", "base", "jupyter", "notebook", "--notebook-dir=/notebooks", "--ip=*", "--port=8888", "--allow-root", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.password=''"]

Then docker build -t langchain_ai . and docker run -d -p 8888:8888 langchain_ai

Note: build-essential is because c++ is required

then goto http://localhost:8888

benman1 commented 6 months ago

Hi @scq000, thanks for reporting, @danrosher thanks for coming up with something that works. the notebook directory and the change to the docker run command were key - thanks for that. I've updated the README and the Dockerfile accordingly. Also, your tag name, langchain_ai, is clearly better than my new_image ;)