Resolve Docker path for VSCode terminals

This commit is contained in:
2026-05-03 17:22:52 +09:00
parent c328ef517e
commit aa14ebc447
6 changed files with 108 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import path from "node:path";
import { spawn } from "node:child_process";
import { loadConfig } from "./config.js";
import { resolveDockerCommand } from "./docker-runtime.js";
import { Logger } from "./logger.js";
import { MeloTtsService } from "./services/melo-tts.js";
@@ -36,6 +37,7 @@ async function run(command: string, args: string[], cwd = process.cwd()): Promis
export async function setupTts(): Promise<void> {
const config = loadConfig();
const logger = new Logger(config.DEBUG ? config.LOG_LEVEL : "error");
const docker = await resolveDockerCommand(config);
const dockerContext = path.resolve(process.cwd(), "docker", "melotts");
const cacheDir = path.resolve(process.cwd(), config.TTS_CACHE_DIR);
const outputDir = path.resolve(process.cwd(), config.TTS_OUTPUT_DIR);
@@ -44,7 +46,7 @@ export async function setupTts(): Promise<void> {
await mkdir(outputDir, { recursive: true });
console.log(`MeloTTS Docker 이미지 빌드: ${config.TTS_IMAGE}`);
await run("docker", ["build", "-t", config.TTS_IMAGE, dockerContext]);
await run(docker, ["build", "-t", config.TTS_IMAGE, dockerContext]);
const tts = new MeloTtsService(config, logger);
const warmupPath = path.join(outputDir, "warmup.wav");