Add direct uvicorn server run and adjust Docker port mapping

This commit is contained in:
vvzvlad
2025-02-02 01:22:37 +03:00
parent d1ae60a14c
commit 79f6db9839
2 changed files with 11 additions and 1 deletions
+9
View File
@@ -28,6 +28,15 @@ app = FastAPI(
lifespan=lifespan
)
if __name__ == "__main__":
import uvicorn
uvicorn.run(
"api_server:app",
host=settings["api_host"],
port=settings["api_port"],
reload=False
)
@app.get("/html/{channel}/{post_id}", response_class=HTMLResponse)
async def get_post_html(channel: str, post_id: int):
try:
+2 -1
View File
@@ -6,9 +6,10 @@ services:
TG_API_ID: //TG_API_ID//
TG_API_HASH: //TG_API_HASH//
TG_SESSION_STRING: //TG_SESSION_STRING//
API_PORT: 8000
TZ: Europe/Moscow
ports:
- "8000:8000"
- "8080:8000"
restart: always
logging:
driver: "json-file"