Skip to content

Commit fe53fe6

Browse files
committed
9527
1 parent e835501 commit fe53fe6

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ RUN pip3 install -r requirements.txt
1717
# 设置环境变量
1818
ENV PYTHONUNBUFFERED=1
1919

20-
# 暴露端口(FastAPI 默认使用 8000 端口
21-
EXPOSE 8000
20+
# 暴露端口(修改为 9527
21+
EXPOSE 9527
2222

23-
# 使用 uvicorn 运行 FastAPI 应用
24-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
23+
# 使用 uvicorn 运行 FastAPI 应用,端口改为 9527
24+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "9527", "--reload"]

banner.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
| 🚀 MarkItDown API Server |
44
| |
55
| ✨ Server is running... |
6-
| 🌐 Visit http://localhost:8000/docs |
6+
|🌐http://localhost:9527/swagger-ui.html |
77
| |
88
+----------------------------------------+

main.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ async def lifespan(app: FastAPI):
3131
except FileNotFoundError:
3232
print("Banner file not found, starting server without banner...")
3333
yield
34-
app = FastAPI(lifespan=lifespan)
34+
app = FastAPI(
35+
lifespan=lifespan,
36+
docs_url="/swagger-ui.html"
37+
)
3538

3639
client = OpenAI(
3740
base_url=ZHIPUAI_BASE_URL,
@@ -45,7 +48,7 @@ async def lifespan(app: FastAPI):
4548
allow_credentials=True,
4649
allow_methods=["*"], # Allows all methods
4750
allow_headers=["*"], # Allows all headers
48-
)
51+
) # FastAPI 默认使用 9527 端口
4952

5053
async def delete_files(file_path: str, output_path: str, delay: int = FILE_DELETE_DELAY):
5154
await asyncio.sleep(delay)

0 commit comments

Comments
 (0)