Skip to content

Commit b857c77

Browse files
support docker compose and update README (#79)
1 parent 2b1cb28 commit b857c77

File tree

3 files changed

+97
-0
lines changed

3 files changed

+97
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,39 @@ docker run -d -p 80:80 \
6262
linshen/prompt-optimizer
6363
```
6464

65+
### 4. Docker Compose部署
66+
```bash
67+
# 1. 克隆仓库
68+
git clone https://github.com/linshenkx/prompt-optimizer.git
69+
cd prompt-optimizer
70+
71+
# 2. 可选:创建.env文件配置API密钥
72+
cat > .env << EOF
73+
VITE_OPENAI_API_KEY=your_openai_api_key
74+
VITE_GEMINI_API_KEY=your_gemini_api_key
75+
VITE_DEEPSEEK_API_KEY=your_deepseek_api_key
76+
EOF
77+
78+
# 3. 启动服务
79+
docker compose up -d
80+
81+
# 4. 查看日志
82+
docker compose logs -f
83+
```
84+
85+
你还可以直接编辑docker-compose.yml文件,自定义配置:
86+
```yaml
87+
services:
88+
prompt-optimizer:
89+
image: linshen/prompt-optimizer:latest
90+
container_name: prompt-optimizer
91+
restart: unless-stopped
92+
ports:
93+
- "8081:80" # 修改端口映射
94+
environment:
95+
- VITE_OPENAI_API_KEY=your_key_here # 直接在配置中设置密钥
96+
```
97+
6598
## ⚙️ API密钥配置
6699
67100
### 方式一:通过界面配置(推荐)

README_EN.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,39 @@ docker run -d -p 80:80 \
6262
linshen/prompt-optimizer
6363
```
6464

65+
### 4. Docker Compose Deployment
66+
```bash
67+
# 1. Clone the repository
68+
git clone https://github.com/linshenkx/prompt-optimizer.git
69+
cd prompt-optimizer
70+
71+
# 2. Optional: Create .env file for API keys
72+
cat > .env << EOF
73+
VITE_OPENAI_API_KEY=your_openai_api_key
74+
VITE_GEMINI_API_KEY=your_gemini_api_key
75+
VITE_DEEPSEEK_API_KEY=your_deepseek_api_key
76+
EOF
77+
78+
# 3. Start the service
79+
docker compose up -d
80+
81+
# 4. View logs
82+
docker compose logs -f
83+
```
84+
85+
You can also edit the docker-compose.yml file directly to customize your configuration:
86+
```yaml
87+
services:
88+
prompt-optimizer:
89+
image: linshen/prompt-optimizer:latest
90+
container_name: prompt-optimizer
91+
restart: unless-stopped
92+
ports:
93+
- "8081:80" # Change port mapping
94+
environment:
95+
- VITE_OPENAI_API_KEY=your_key_here # Set API key directly in config
96+
```
97+
6598
## ⚙️ API Key Configuration
6699
67100
### Method 1: Via Interface (Recommended)

docker-compose.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
services:
2+
prompt-optimizer:
3+
image: linshen/prompt-optimizer:latest
4+
# Alternatively, you can build from source:
5+
# build:
6+
# context: .
7+
# dockerfile: Dockerfile
8+
container_name: prompt-optimizer
9+
restart: unless-stopped
10+
ports:
11+
- "8081:80"
12+
environment:
13+
# OpenAI API配置
14+
- VITE_OPENAI_API_KEY=${VITE_OPENAI_API_KEY:-}
15+
# Gemini API配置
16+
- VITE_GEMINI_API_KEY=${VITE_GEMINI_API_KEY:-}
17+
# DeepSeek API配置
18+
- VITE_DEEPSEEK_API_KEY=${VITE_DEEPSEEK_API_KEY:-}
19+
# SiliconFlow API配置
20+
- VITE_SILICONFLOW_API_KEY=${VITE_SILICONFLOW_API_KEY:-}
21+
# 自定义API配置
22+
- VITE_CUSTOM_API_KEY=${VITE_CUSTOM_API_KEY:-}
23+
- VITE_CUSTOM_API_BASE_URL=${VITE_CUSTOM_API_BASE_URL:-}
24+
- VITE_CUSTOM_API_MODEL=${VITE_CUSTOM_API_MODEL:-}
25+
# 健康检查
26+
healthcheck:
27+
test: ["CMD", "curl", "-f", "http://localhost:80"]
28+
interval: 30s
29+
timeout: 10s
30+
retries: 3
31+
start_period: 5s

0 commit comments

Comments
 (0)