feat: add Docker deployment for the bot
- Add Dockerfile for Python 3.13 container - Update docker-compose with naliia_bot service - Add DB_HOST config for container networking - Add .dockerignore for build optimization - Update README with Docker documentation
This commit is contained in:
@@ -6,8 +6,9 @@ from .settings import _settings as st
|
||||
|
||||
|
||||
_protocol = "postgresql://"
|
||||
_connection_string =\
|
||||
f"{_protocol}{st.DB_USER}:{st.DB_PASSWORD}@localhost:5432/{st.DB_NAME}"
|
||||
_connection_string = (
|
||||
f"{_protocol}{st.DB_USER}:{st.DB_PASSWORD}@{st.DB_HOST}:5432/{st.DB_NAME}"
|
||||
)
|
||||
agent_instance: Agent | None = None
|
||||
db_pool = None
|
||||
|
||||
@@ -26,8 +27,5 @@ def get_async_connection_pool():
|
||||
conninfo=_connection_string,
|
||||
max_size=20,
|
||||
open=False,
|
||||
kwargs={
|
||||
"autocommit": True,
|
||||
"prepare_threshold": 0,
|
||||
"row_factory": dict_row
|
||||
})
|
||||
kwargs={"autocommit": True, "prepare_threshold": 0, "row_factory": dict_row},
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ class Settings:
|
||||
DB_NAME = os.getenv("POSTGRES_DB", "messages")
|
||||
DB_USER = os.getenv("POSTGRES_USER", "postgres")
|
||||
DB_PASSWORD = os.getenv("POSTGRES_PASSWORD", "postgres")
|
||||
DB_HOST = os.getenv("POSTGRES_HOST", "localhost")
|
||||
|
||||
def __init__(self):
|
||||
load_dotenv()
|
||||
|
||||
Reference in New Issue
Block a user