From 2d1e338fc8f8b6c616c69aa3dad6ad7a031658bc Mon Sep 17 00:00:00 2001 From: Soaibuzzaman Date: Thu, 9 Nov 2023 17:02:48 +0100 Subject: [PATCH] modify docker compose with env_file --- backend/config.py | 1 - docker-compose.yml | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/config.py b/backend/config.py index 511e48e..a4ffb36 100644 --- a/backend/config.py +++ b/backend/config.py @@ -11,7 +11,6 @@ flask_env = os.getenv('FLASK_ENV') class Config: DEBUG = True - print(f"FLASK_ENV: {flask_env}") SQLALCHEMY_DATABASE_URI = "postgresql://postgres:postgres@localhost:5432/postgres" if flask_env == 'production': DEBUG = False diff --git a/docker-compose.yml b/docker-compose.yml index 5a3fb00..f757076 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,6 +27,8 @@ services: - "8000:8000" networks: - my_network + env_file: + - .env restart: unless-stopped postgres: @@ -42,6 +44,8 @@ services: interval: 5s timeout: 5s retries: 5 + env_file: + - .env networks: - my_network