update sth at 2025-10-15 15:49:03
Browse files- .replit +3 -3
- Dockerfile +2 -2
- app/core/config.py +1 -1
- docker-compose.yml +1 -1
- nginx.conf +1 -1
.replit
CHANGED
|
@@ -6,11 +6,11 @@ packages = ["cargo", "libiconv", "libxcrypt", "python311", "rustc"]
|
|
| 6 |
|
| 7 |
# 这是第二关键的修改:我们使用 FastAPI 官方推荐的 uvicorn 来启动服务器。
|
| 8 |
# 这将彻底解决所有兼容性问题。
|
| 9 |
-
run = "uvicorn main:app --host 0.0.0.0 --port
|
| 10 |
|
| 11 |
# 这一行保持不变。
|
| 12 |
entrypoint = "main.py"
|
| 13 |
|
| 14 |
[[ports]]
|
| 15 |
-
localPort =
|
| 16 |
-
externalPort =
|
|
|
|
| 6 |
|
| 7 |
# 这是第二关键的修改:我们使用 FastAPI 官方推荐的 uvicorn 来启动服务器。
|
| 8 |
# 这将彻底解决所有兼容性问题。
|
| 9 |
+
run = "uvicorn main:app --host 0.0.0.0 --port 7860"
|
| 10 |
|
| 11 |
# 这一行保持不变。
|
| 12 |
entrypoint = "main.py"
|
| 13 |
|
| 14 |
[[ports]]
|
| 15 |
+
localPort = 7860
|
| 16 |
+
externalPort = 7860
|
Dockerfile
CHANGED
|
@@ -35,11 +35,11 @@ RUN mkdir -p /app/data && \
|
|
| 35 |
USER app
|
| 36 |
|
| 37 |
# Expose port
|
| 38 |
-
EXPOSE
|
| 39 |
|
| 40 |
# Health check
|
| 41 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 42 |
-
CMD curl -f http://localhost:
|
| 43 |
|
| 44 |
# Run the application
|
| 45 |
CMD ["python", "main.py"]
|
|
|
|
| 35 |
USER app
|
| 36 |
|
| 37 |
# Expose port
|
| 38 |
+
EXPOSE 7860
|
| 39 |
|
| 40 |
# Health check
|
| 41 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 42 |
+
CMD curl -f http://localhost:7860/ || exit 1
|
| 43 |
|
| 44 |
# Run the application
|
| 45 |
CMD ["python", "main.py"]
|
app/core/config.py
CHANGED
|
@@ -24,7 +24,7 @@ class Settings(BaseSettings):
|
|
| 24 |
GLM_46_THINKING_MODEL: str = os.getenv("GLM_46_THINKING_MODEL", "GLM-4.6-Thinking")
|
| 25 |
|
| 26 |
# Server Configuration
|
| 27 |
-
LISTEN_PORT: int = int(os.getenv("LISTEN_PORT", "
|
| 28 |
DEBUG_LOGGING: bool = os.getenv("DEBUG_LOGGING", "true").lower() == "true"
|
| 29 |
|
| 30 |
# Feature Configuration
|
|
|
|
| 24 |
GLM_46_THINKING_MODEL: str = os.getenv("GLM_46_THINKING_MODEL", "GLM-4.6-Thinking")
|
| 25 |
|
| 26 |
# Server Configuration
|
| 27 |
+
LISTEN_PORT: int = int(os.getenv("LISTEN_PORT", "7860"))
|
| 28 |
DEBUG_LOGGING: bool = os.getenv("DEBUG_LOGGING", "true").lower() == "true"
|
| 29 |
|
| 30 |
# Feature Configuration
|
docker-compose.yml
CHANGED
|
@@ -16,7 +16,7 @@ services:
|
|
| 16 |
deploy:
|
| 17 |
replicas: 2
|
| 18 |
healthcheck:
|
| 19 |
-
test: ["CMD", "curl", "-f", "http://localhost:
|
| 20 |
interval: 30s
|
| 21 |
timeout: 10s
|
| 22 |
retries: 3
|
|
|
|
| 16 |
deploy:
|
| 17 |
replicas: 2
|
| 18 |
healthcheck:
|
| 19 |
+
test: ["CMD", "curl", "-f", "http://localhost:7860/"]
|
| 20 |
interval: 30s
|
| 21 |
timeout: 10s
|
| 22 |
retries: 3
|
nginx.conf
CHANGED
|
@@ -8,7 +8,7 @@ http {
|
|
| 8 |
upstream z_ai_workers {
|
| 9 |
# 'z-ai2api' 是我们在 docker-compose.yml 中定义的服务名
|
| 10 |
# Docker 的内部 DNS 会解析它,并把所有工人的 IP 地址都加进来
|
| 11 |
-
server z-ai2api:
|
| 12 |
}
|
| 13 |
|
| 14 |
server {
|
|
|
|
| 8 |
upstream z_ai_workers {
|
| 9 |
# 'z-ai2api' 是我们在 docker-compose.yml 中定义的服务名
|
| 10 |
# Docker 的内部 DNS 会解析它,并把所有工人的 IP 地址都加进来
|
| 11 |
+
server z-ai2api:7860;
|
| 12 |
}
|
| 13 |
|
| 14 |
server {
|