diff --git a/Dockerfile b/Dockerfile index 03da201..4a7b44c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,9 @@ ENV LANG =C.UTF-8 # Python variables ENV PYTHONPATH /source +# Port settings +EXPOSE 8000 + # RUN # ---------------------------------------------------------------------- # diff --git a/telathbot/config.py b/telathbot/config.py index 8e7c750..5529999 100644 --- a/telathbot/config.py +++ b/telathbot/config.py @@ -26,6 +26,7 @@ class Settings(BaseSettings): # TelathBot telathbot_db_url: AnyUrl + telathbot_port: int = 8000 class Config: env_file = ".env" diff --git a/telathbot/main.py b/telathbot/main.py index 9c9e4d8..ca8f7be 100644 --- a/telathbot/main.py +++ b/telathbot/main.py @@ -1,6 +1,8 @@ import uvicorn from telathbot import app +from telathbot.config import get_settings if __name__ == "__main__": - uvicorn.run(app, host="0.0.0.0", port=8000) + config = get_settings() + uvicorn.run(app, host="0.0.0.0", port=config.telathbot_port)