Skip to content

Commit 9e68a38

Browse files
Add dockerfile & docker compose method (#239)
* Add dockerfile & docker compose method * delete docker compose files & update dockerfile to uv mode
1 parent 04ff531 commit 9e68a38

File tree

3 files changed

+106
-1
lines changed

3 files changed

+106
-1
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ghcr.io/astral-sh/uv:python3.10-bookworm-slim
2+
3+
WORKDIR /app
4+
5+
RUN mkdir -p /tmp/uv-cache /app/data /app/logs
6+
7+
COPY pyproject.toml uv.lock LICENSE README.md ./
8+
COPY deepsearcher/ ./deepsearcher/
9+
10+
RUN uv sync
11+
12+
COPY . .
13+
14+
EXPOSE 8000
15+
16+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
17+
CMD curl -f http://localhost:8000/docs || exit 1
18+
19+
CMD ["uv", "run", "python", "main.py", "--enable-cors", "true"]

docs/usage/deployment.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,39 @@ You can access the web service through your browser:
3535
3. Click the "Try it out" button on any endpoint to interact with it
3636
4. Fill in the required parameters and execute the request
3737

38-
This interactive documentation makes it easy to test and use all DeepSearcher API functionality.
38+
This interactive documentation makes it easy to test and use all DeepSearcher API functionality.
39+
40+
## 🐳 Docker Deployment
41+
42+
You can also deploy DeepSearcher using Docker for easier environment setup and management.
43+
44+
### Build Docker Image
45+
46+
To build the Docker image, run the following command from the project root directory:
47+
48+
```shell
49+
docker build -t deepsearcher:latest .
50+
```
51+
52+
This command builds a Docker image using the Dockerfile in the current directory and tags it as `deepsearcher:latest`.
53+
54+
### Run Docker Container
55+
56+
Once the image is built, you can run it as a container:
57+
58+
```shell
59+
docker run -p 8000:8000 \
60+
-e OPENAI_API_KEY=your_openai_api_key \
61+
-v $(pwd)/data:/app/data \
62+
-v $(pwd)/logs:/app/logs \
63+
-v $(pwd)/deepsearcher/config.yaml:/app/deepsearcher/config.yaml \
64+
deepsearcher:latest
65+
```
66+
67+
This command:
68+
- Maps port 8000 from the container to port 8000 on your host
69+
- Sets the `OPENAI_API_KEY` environment variable
70+
- Mounts the local `data`, `logs`, and configuration file to the container
71+
- Runs the previously built `deepsearcher:latest` image
72+
73+
> **Note:** Replace `your_openai_api_key` with your actual OpenAI API key, or set any other environment variables required for your configuration.

env.example

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copy this file to .env and fill in your API keys
2+
3+
# OpenAI API Key (required if using OpenAI models)
4+
OPENAI_API_KEY=your_openai_api_key_here
5+
6+
# DeepSeek API Key (required if using DeepSeek models)
7+
DEEPSEEK_API_KEY=your_deepseek_api_key_here
8+
9+
# SiliconFlow API Key (required if using SiliconFlow models)
10+
SILICONFLOW_API_KEY=your_siliconflow_api_key_here
11+
12+
# PPIO API Key (required if using PPIO models)
13+
PPIO_API_KEY=your_ppio_api_key_here
14+
15+
# Together AI API Key (required if using Together AI models)
16+
TOGETHER_API_KEY=your_together_api_key_here
17+
18+
# XAI API Key (required if using XAI Grok models)
19+
XAI_API_KEY=your_xai_api_key_here
20+
21+
# Anthropic API Key (required if using Claude models)
22+
ANTHROPIC_API_KEY=your_anthropic_api_key_here
23+
24+
# Gemini API Key (required if using Gemini models)
25+
GEMINI_API_KEY=your_gemini_api_key_here
26+
27+
# Voyage API Key (required if using Voyage embeddings)
28+
VOYAGE_API_KEY=your_voyage_api_key_here
29+
30+
# FireCrawl API Key (required if using web crawling features)
31+
FIRECRAWL_API_KEY=your_firecrawl_api_key_here
32+
33+
# Aliyun Bailian API Key (required if using Qwen models from Aliyun)
34+
DASHSCOPE_API_KEY=your_dashscope_api_key_here
35+
36+
# Azure OpenAI Configuration (required if using Azure OpenAI)
37+
AZURE_OPENAI_ENDPOINT=your_azure_openai_endpoint_here
38+
AZURE_OPENAI_KEY=your_azure_openai_key_here
39+
40+
# AWS Credentials (required if using AWS Bedrock)
41+
AWS_ACCESS_KEY_ID=your_aws_access_key_id_here
42+
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key_here
43+
44+
# Novita API Key (required if using Novita models)
45+
NOVITA_API_KEY=your_novita_api_key_here
46+
47+
# GLM API Key (required if using GLM models)
48+
GLM_API_KEY=your_glm_api_key_here
49+
50+
# Volcengine API Key (required if using Volcengine models)
51+
VOLCENGINE_API_KEY=your_volcengine_api_key_here

0 commit comments

Comments
 (0)