From 2d489812a3758e7e9f2b8a534c35408182c8a892 Mon Sep 17 00:00:00 2001 From: Igor Kuzmenkov <74809945+IgorDuino@users.noreply.github.com> Date: Wed, 5 Feb 2025 05:39:30 +0300 Subject: [PATCH] Dockerize repo, create Dockerfile, docker-compose.yml and update README.md (#17) --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/jina-ai/node-DeepResearch?shareId=XXXX-XXXX-XXXX-XXXX). --- Dockerfile | 28 ++++++++++++++++++++++++++++ README.md | 19 +++++++++++++++++++ docker-compose.yml | 13 +++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b050a49 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Use Node.js 20 as the base image +FROM node:20 + +# Set the working directory +WORKDIR /app + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the application code +COPY . . + +# Set environment variables +ENV GEMINI_API_KEY=${GEMINI_API_KEY} +ENV JINA_API_KEY=${JINA_API_KEY} +ENV BRAVE_API_KEY=${BRAVE_API_KEY} + +# Build the application +RUN npm run build + +# Expose the port the app runs on +EXPOSE 3000 + +# Set the default command to run the application +CMD ["npm", "run", "serve"] diff --git a/README.md b/README.md index cf8de2f..cb302b9 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,25 @@ data: {"type":"progress","trackers":{"tokenUsage":74950,"tokenBreakdown":{"agent data: {"type":"progress","trackers":{"tokenUsage":88096,"tokenBreakdown":{"agent":77777,"read":10319},"actionState":{"action":"search","thoughts":"The provided text mentions several investors in Jina AI's funding rounds but doesn't specify ownership percentages. A search focusing on equity stakes and ownership percentages held by each investor will provide the necessary information to answer the main question.","URLTargets":[],"answer":"","questionsToAnswer":[],"references":[],"searchQuery":"Jina AI investor equity percentage ownership stake"},"step":8,"badAttempts":0,"gaps":[]}} ``` +## Docker + +### Build Docker Image +To build the Docker image for the application, run the following command: +```bash +docker build -t deepresearch:latest . +``` + +### Run Docker Container +To run the Docker container, use the following command: +```bash +docker run -p 3000:3000 --env GEMINI_API_KEY=your_gemini_api_key --env JINA_API_KEY=your_jina_api_key --env BRAVE_API_KEY=your_brave_api_key deepresearch:latest +``` + +### Docker Compose +You can also use Docker Compose to manage multi-container applications. To start the application with Docker Compose, run: +```bash +docker-compose up +``` ## How Does it Work? diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c374217 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' + +services: + app: + build: + context: . + dockerfile: Dockerfile + environment: + - GEMINI_API_KEY=${GEMINI_API_KEY} + - JINA_API_KEY=${JINA_API_KEY} + - BRAVE_API_KEY=${BRAVE_API_KEY} + ports: + - "3000:3000"