feat(main): 添加 Docker 网络验证并更新 nginx 模块导入

- 在 main.py 中添加 Docker 网络验证功能,如果未创建所需网络,记录错误信息
- 更新 nginx.py 中 logger 模块的导入路径,使用相对路径导入
This commit is contained in:
ZZY 2025-04-26 17:43:19 +08:00
parent c1b2d0e50e
commit 07d5f3c0ab
2 changed files with 4 additions and 1 deletions

View File

@ -139,6 +139,9 @@ def main():
# 配置生成
try:
if not validate_docker_network():
logger.error("请先创建Docker网络,否则nginx将会失效: docker network create %s", NETWORK_NAME)
inner, outter = parse_yaml_config(Path(args.input))
# 根据类型选择配置

View File

@ -8,7 +8,7 @@ from pathlib import Path
import shutil
import subprocess
from logger import get_logger
from src.logger import get_logger
logger = get_logger(__name__)
NGINX_CONF_DIR = Path("nginx/conf/conf.d")