4
from dotenv import load_dotenv
5
from pydantic import BaseConfig
7
from core.service_config import Config as CoreConfig
9
BaseConfig.arbitrary_types_allowed = True
10
logging.basicConfig(level=logging.INFO)
15
class Config(CoreConfig):
16
BROKER_PATH: str = 'app.inventory.inventory_server:app'
17
APP_HOST: str = os.environ.get("INVENTORY_HOST") or os.environ.get("APP_HOST") or '127.0.0.1'
18
APP_PORT: int = os.environ.get("INVENTORY_PORT") or os.environ.get("APP_PORT") or '8002'
19
APP_PROTOCOL: str = os.environ.get('INVENTORY_PROTOCOL') or os.environ.get(
20
'APP_PROTOCOL') or 'http'
23
class DevelopmentConfig(Config):
27
class DockerConfig(Config):
28
APP_HOST: str = 'inventory_app'
32
class LocalConfig(Config):
36
class ProductionConfig(Config):
41
env = os.getenv("ENV", "local")
42
for name, value in os.environ.items():
43
# logging.info("{0}: {1}".format(name, value))
44
# print("{0}: {1}".format(name, value))
47
"dev": DevelopmentConfig(),
48
"local": LocalConfig(),
49
"docker": DockerConfig(),
50
"prod": ProductionConfig(),
52
return config_type[env]
55
config: Config = get_config()