Add direct uvicorn server run and adjust Docker port mapping
This commit is contained in:
@@ -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
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user