From 1d0777f7c4a53466a61a249baddd782776ad0790 Mon Sep 17 00:00:00 2001 From: Julian Ortega Date: Wed, 12 Jul 2023 19:58:20 +0200 Subject: [PATCH] Add docker convenience to run it locally --- .dockerignore | 1 + Dockerfile | 12 ++++++++++++ README.md | 26 ++++++++++++++++++++++---- docker-compose.yml | 9 +++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..191381e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..09d84ad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.11.4 + +WORKDIR /app + +COPY ./requirements.txt ./requirements.txt +RUN pip install -r requirements.txt +COPY ./ ./ + + +EXPOSE 8000 +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] + diff --git a/README.md b/README.md index f8942b6..285f6bc 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,6 @@ https://github.com/assafelovic/gpt-researcher/assets/13554167/a00c89a6-a295-4dd0 - 📂 Keeps track and context of visited and used web sources - 📄 Export research reports to PDF and more... -## Tutorials -- [How to Install](https://www.loom.com/share/04ebffb6ed2a4520a27c3e3addcdde20?sid=da1848e8-b1f1-42d1-93c3-5b0b9c3b24ea) -- [Live Demo](https://www.loom.com/share/6a3385db4e8747a1913dd85a7834846f?sid=a740fd5b-2aa3-457e-8fb7-86976f59f9b8) - ## Quickstart > **Step 0** - Install Python 3.11 or later. [See here](https://www.tutorialsteacher.com/python/install-python) for a step-by-step guide. @@ -84,6 +80,28 @@ $ uvicorn main:app --reload - **update:** if you are having issues with weasyprint, please visit their website and follow the installation instructions: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html +## Try it with Docker + +> **Step 1** - Install Docker + +Follow instructions at https://docs.docker.com/engine/install/ + +> **Step 2** - Create .env file with your OpenAI Key or simply export it + +```bash +$ export OPENAI_API_KEY={Your API Key here} +``` + +> **Step 3** - Run the application + +```bash +$ docker-compose up +``` + +> **Step 4** - Go to http://localhost:8000 on any browser and enjoy researching! + +- **update:** if you are having issues with weasyprint, please visit their website and follow the installation instructions: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html + ## 🛡 Disclaimer This project, GPT Researcher, is an experimental application and is provided "as-is" without any warranty, express or implied. We are sharing codes for academic purposes under the MIT education license. Nothing herein is academic advice, and NOT a recommendation to use in academic or research papers. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..05c9ec1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' +services: + gpt-researcher: + image: assafelovic/gpt-researcher + build: ./ + environment: + OPENAI_API_KEY: ${OPENAI_API_KEY} + ports: + - 8000:8000 \ No newline at end of file