import json import yaml # Load the channels from channels.json with open("channels.json", "r") as f: channels = json.load(f) compose = { "services": {} } # For each channel, create a service entry for channel in channels: service_name = f"scanner_{channel}" compose["services"][service_name] = { "image": "twitch-scanner:latest", "environment": [ f"CHANNEL_NAME={channel['name']}", f"CHANNEL_LANGUAGE={channel['language']}", "TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov", "TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es" ], "volumes": [ "./clips:/app/clips", # Shared clips folder on the host "./models:/app/models", "./transcripts:/app/transcripts" ] } # Write the docker-compose file with open("docker-compose.yml", "w") as f: yaml.dump(compose, f, default_flow_style=False) print("docker-compose.yml generated successfully.")