File tree 3 files changed +97
-0
lines changed 3 files changed +97
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,39 @@ docker run -d -p 80:80 \
62
62
linshen/prompt-optimizer
63
63
```
64
64
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
+
65
98
## ⚙️ API密钥配置
66
99
67
100
### 方式一:通过界面配置(推荐)
Original file line number Diff line number Diff line change @@ -62,6 +62,39 @@ docker run -d -p 80:80 \
62
62
linshen/prompt-optimizer
63
63
```
64
64
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
+
65
98
## ⚙️ API Key Configuration
66
99
67
100
### Method 1: Via Interface (Recommended)
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments