Skip to content

Commit

Permalink
Set up port in config & Docker Container. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanklee86 committed Jan 17, 2022
1 parent 3034b72 commit ec692b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Expand Up @@ -34,6 +34,9 @@ ENV LANG =C.UTF-8
# Python variables
ENV PYTHONPATH /source

# Port settings
EXPOSE 8000

# RUN
# ---------------------------------------------------------------------- #

Expand Down
1 change: 1 addition & 0 deletions telathbot/config.py
Expand Up @@ -26,6 +26,7 @@ class Settings(BaseSettings):

# TelathBot
telathbot_db_url: AnyUrl
telathbot_port: int = 8000

class Config:
env_file = ".env"
4 changes: 3 additions & 1 deletion 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)

0 comments on commit ec692b2

Please sign in to comment.