Skip to content

Commit a14dc3b

Browse files
committed
removed dependency to .env file in docker-compose
1 parent 7c00422 commit a14dc3b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

alembic/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from alembic import context
1010

1111
# load_environment variables to avoid exposing the secrets
12-
load_dotenv()
12+
load_dotenv(verbose=True)
1313

1414
# get the database URL from environment
1515
DB_HOST = os.getenv("DB_HOST")

docker-compose.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ services:
33
image: postgres:16
44
container_name: postgres_expense_db
55
restart: always
6-
env_file: .env
76
environment:
87
- POSTGRES_USER=${DB_USER}
98
- POSTGRES_PASSWORD=${DB_PASSWORD}
@@ -20,7 +19,12 @@ services:
2019
restart: always
2120
depends_on:
2221
- db
23-
env_file: .env
22+
environment:
23+
- DB_HOST=${DB_HOST}
24+
- DB_NAME=${DB_NAME}
25+
- DB_USER=${DB_USER}
26+
- DB_PASSWORD=${DB_PASSWORD}
27+
- DB_PORT=${DB_PORT}
2428
ports:
2529
- "8000:8000"
2630
volumes:

0 commit comments

Comments
 (0)