feat(08): implement SSOT architecture for network configuration
This commit is contained in:
@@ -210,12 +210,25 @@ def main():
|
||||
|
||||
# Prepare environment variables for Docker Compose
|
||||
# We map YAML values to the environment variables expected by docker-compose.yml
|
||||
server_ip = network_cfg.get("application", {}).get("server_ip", "localhost")
|
||||
ssl_enabled = network_cfg.get("ssl", {}).get("ssl_enabled", False)
|
||||
|
||||
# Dynamically construct API URL from master settings
|
||||
if ssl_enabled:
|
||||
api_url = f"https://{server_ip}:{ports_to_check['Backend HTTPS']}"
|
||||
else:
|
||||
api_url = f"http://{server_ip}:{ports_to_check['Backend HTTP']}"
|
||||
|
||||
logger.info(f"Dynamically injecting API URL into Docker: {api_url}")
|
||||
|
||||
env = os.environ.copy()
|
||||
env["BACKEND_PORT"] = str(ports_to_check["Backend HTTP"])
|
||||
env["FRONTEND_PORT"] = str(ports_to_check["Frontend HTTP"])
|
||||
env["BACKEND_SSL_PORT"] = str(ports_to_check["Backend HTTPS"])
|
||||
env["FRONTEND_SSL_PORT"] = str(ports_to_check["Frontend HTTPS"])
|
||||
env["JWT_SECRET_KEY"] = jwt_secret or "change_me_in_production"
|
||||
env["NEXT_PUBLIC_API_URL"] = api_url
|
||||
env["SERVER_IP"] = server_ip
|
||||
|
||||
# 8. Docker Compose Build
|
||||
logger.info("Step 8/12: Building/Pulling Docker images...")
|
||||
|
||||
Reference in New Issue
Block a user