import yaml

try:
    with open('d:/FzxBDSH/infrastructure/compose/podman-compose.aliyun-dev.yml', 'r', encoding='utf-8') as f:
        config = yaml.safe_load(f)
    
    print('✅ Compose配置文件格式正确')
    print(f'服务数量: {len(config["services"])}')
    print(f'网络配置: {list(config["networks"].keys())}')
    print(f'卷配置: {len(config["volumes"])}个')
    
    # 检查是否所有服务都有deploy配置
    services_with_deploy = []
    services_without_deploy = []
    
    for service_name, service_config in config['services'].items():
        if 'deploy' in service_config and 'resources' in service_config['deploy']:
            services_with_deploy.append(service_name)
        else:
            services_without_deploy.append(service_name)
    
    print(f'\n有资源限制的服务: {len(services_with_deploy)}个')
    print(f'无资源限制的服务: {len(services_without_deploy)}个')
    if services_without_deploy:
        print(f'  缺少配置的服务: {services_without_deploy}')
        
except Exception as e:
    print(f'❌ 配置文件解析失败: {e}')
