Add CONFIG_PATH environment variable for configurable config file location
- Replace hardcoded remotes.yaml path with CONFIG_PATH environment variable - Update docker-compose.yml to set CONFIG_PATH=/app/remotes.yaml - Application now requires CONFIG_PATH to be set, enabling flexible deployment
This commit is contained in:
parent
46711eec6a
commit
666ad08518
@ -9,6 +9,7 @@ services:
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- CONFIG_PATH=/app/remotes.yaml
|
||||
- DBHOST=postgres
|
||||
- DBPORT=5432
|
||||
- DBUSER=artifacts
|
||||
|
||||
@ -23,7 +23,10 @@ class ArtifactRequest(BaseModel):
|
||||
app = FastAPI(title="Artifact Storage API", version="2.0.0")
|
||||
|
||||
# Initialize components using config
|
||||
config = ConfigManager("remotes.yaml")
|
||||
config_path = os.environ.get("CONFIG_PATH")
|
||||
if not config_path:
|
||||
raise ValueError("CONFIG_PATH environment variable is required")
|
||||
config = ConfigManager(config_path)
|
||||
|
||||
# Get configurations
|
||||
s3_config = config.get_s3_config()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user