Skip to content

Commit c70c3e0

Browse files
committed
docker update
1 parent 405e0db commit c70c3e0

File tree

5 files changed

+68
-8
lines changed

5 files changed

+68
-8
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PORT=7000
66
VERIFY_SSL=true
77

88
# Proxy configuration
9-
USE_PROXY=false
9+
USE_PROXY=true
1010
PROXY_API_URL=https://proxy.scdn.io/api/get_proxy.php
1111
PROXY_PROTOCOL=http
1212
PROXY_BATCH_SIZE=5

Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ COPY proxy/ proxy/
1717
COPY utils/ utils/
1818
COPY static/ static/
1919

20+
# Set default environment variables
21+
ENV HOST=0.0.0.0 \
22+
PORT=7000 \
23+
VERIFY_SSL=true \
24+
USE_PROXY=true \
25+
PROXY_API_URL=https://proxy.scdn.io/api/get_proxy.php \
26+
PROXY_PROTOCOL=http \
27+
PROXY_BATCH_SIZE=5 \
28+
MAX_QUEUE_SIZE=100
29+
2030
# Expose port 7000
2131
EXPOSE 7000
2232

23-
# Command to run the application with host set to 0.0.0.0
24-
CMD ["python", "main.py", "--host", "0.0.0.0"]
33+
# Command to run the application
34+
CMD ["python", "main.py"]

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,41 @@ ttsfm/
4141
- Or Docker environment
4242

4343
### 🐳 Docker Run (Recommended)
44+
45+
Basic usage:
4446
```bash
4547
docker run -p 7000:7000 dbcccc/ttsfm:latest
4648
```
4749

50+
Custom configuration using environment variables:
51+
```bash
52+
docker run -d \
53+
-p 7000:7000 \
54+
-e HOST=0.0.0.0 \
55+
-e PORT=7000 \
56+
-e VERIFY_SSL=true \
57+
-e USE_PROXY=false \
58+
-e PROXY_API_URL=https://proxy.scdn.io/api/get_proxy.php \
59+
-e PROXY_PROTOCOL=http \
60+
-e PROXY_BATCH_SIZE=5 \
61+
-e MAX_QUEUE_SIZE=100 \
62+
dbcccc/ttsfm:latest
63+
```
64+
65+
Available environment variables:
66+
- `HOST`: Server host (default: 0.0.0.0)
67+
- `PORT`: Server port (default: 7000)
68+
- `VERIFY_SSL`: Whether to verify SSL certificates (default: true)
69+
- `USE_PROXY`: Whether to use proxy pool (default: true)
70+
- `PROXY_API_URL`: Proxy API URL (default: https://proxy.scdn.io/api/get_proxy.php)
71+
- `PROXY_PROTOCOL`: Proxy protocol (default: http)
72+
- `PROXY_BATCH_SIZE`: Number of proxies to fetch at once (default: 5)
73+
- `MAX_QUEUE_SIZE`: Maximum number of tasks in queue (default: 100)
74+
4875
> 💡 **Tip**
4976
> MacOS users experiencing port conflicts can use alternative ports:
5077
> `docker run -p 5051:7000 dbcccc/ttsfm:latest`
5178
52-
Below is the simplified manual installation section, retaining only the release package download method:
53-
5479
### 📦 Manual Installation
5580

5681
1. Download the latest release package from [GitHub Releases](https://github.com/dbccccccc/ttsfm/releases)

README_CN.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,41 @@ ttsfm/
4242
- 或 Docker 环境
4343

4444
### 🐳 Docker 运行(推荐)
45+
46+
基本用法:
4547
```bash
4648
docker run -p 7000:7000 dbcccc/ttsfm:latest
4749
```
4850

51+
使用环境变量自定义配置:
52+
```bash
53+
docker run -d \
54+
-p 7000:7000 \
55+
-e HOST=0.0.0.0 \
56+
-e PORT=7000 \
57+
-e VERIFY_SSL=true \
58+
-e USE_PROXY=false \
59+
-e PROXY_API_URL=https://proxy.scdn.io/api/get_proxy.php \
60+
-e PROXY_PROTOCOL=http \
61+
-e PROXY_BATCH_SIZE=5 \
62+
-e MAX_QUEUE_SIZE=100 \
63+
dbcccc/ttsfm:latest
64+
```
65+
66+
可用的环境变量:
67+
- `HOST`:服务器主机(默认:0.0.0.0)
68+
- `PORT`:服务器端口(默认:7000)
69+
- `VERIFY_SSL`:是否验证 SSL 证书(默认:true)
70+
- `USE_PROXY`:是否使用代理池(默认:true)
71+
- `PROXY_API_URL`:代理 API URL(默认:https://proxy.scdn.io/api/get_proxy.php)
72+
- `PROXY_PROTOCOL`:代理协议(默认:http)
73+
- `PROXY_BATCH_SIZE`:一次获取的代理数量(默认:5)
74+
- `MAX_QUEUE_SIZE`:队列最大任务数(默认:100)
75+
4976
> 💡 **提示**
5077
> MacOS 用户若遇到端口冲突,可替换端口号:
5178
> `docker run -p 5051:7000 dbcccc/ttsfm:latest`
5279
53-
以下是精简后的手动安装部分,仅保留发行版下载方式:
54-
5580
### 📦 手动安装
5681

5782
1.[GitHub Releases](https://github.com/dbccccccc/ttsfm/releases) 下载最新版本压缩包

utils/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def load_config():
2424
default_host = os.getenv("HOST", "localhost")
2525
default_port = int(os.getenv("PORT", "7000"))
2626
default_verify_ssl = os.getenv("VERIFY_SSL", "true").lower() != "false"
27-
default_use_proxy = os.getenv("USE_PROXY", "false").lower() == "true"
27+
default_use_proxy = os.getenv("USE_PROXY", "true").lower() == "true"
2828
default_proxy_api = os.getenv("PROXY_API_URL", "https://proxy.scdn.io/api/get_proxy.php")
2929
default_proxy_protocol = os.getenv("PROXY_PROTOCOL", "http")
3030
default_proxy_batch_size = int(os.getenv("PROXY_BATCH_SIZE", "5"))

0 commit comments

Comments
 (0)