Skip to content

Commit 89e5162

Browse files
committed
feat(config): Add environment-based database host configuration for local development
1 parent c1e2353 commit 89e5162

3 files changed

Lines changed: 1 addition & 7 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,4 @@ cython_debug/
145145
/.github/DEMO/
146146
/app/logs/
147147
/app/core/logs/
148-
/app/db/migrations/versions/
149148
/app/certs/

app/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def db_url(self) -> URL:
196196
"""
197197
return URL.build(
198198
scheme="postgresql+asyncpg",
199-
host=self.DB_HOST,
199+
host="localhost" if self.ENVIRONMENT in ["debug", "local"] else self.DB_HOST,
200200
port=self.DB_PORT,
201201
user=self.DB_USER,
202202
password=self.DB_PASS,

docker-compose.override.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ services:
9898
volumes:
9999
# Adds current directory as volume.
100100
- .:/app/src/
101-
command:
102-
- taskiq
103-
- worker
104-
- app.core.tkq:broker
105-
# - --reload
106101

107102
redis:
108103
restart: "no"

0 commit comments

Comments
 (0)