Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async function main(): Promise<void> {
runMigrations();
} catch (error) {
logError("Setup failed: " + (error as Error).message);
process.exit(1);
}
}

Expand Down
7 changes: 7 additions & 0 deletions setup/steps/3_docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
logError,
getProjectRoot,
checkDocker,
dockerDaemonRunning,
} from "../utils";

// Start Docker Compose services
Expand Down Expand Up @@ -36,6 +37,12 @@ export function startDockerServices(): void {
throw new Error("Docker Compose file not found");
}

if (!dockerDaemonRunning(dockerCommand)) {
throw new Error(
`${dockerCommand} daemon is not running. Please start ${dockerCommand} Desktop.`,
);
}

// Start Docker Compose services in detached mode
logInfo("Starting Docker Compose services...");
execSync(`${dockerCommand} compose up -d`, {
Expand Down
10 changes: 10 additions & 0 deletions setup/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ export function checkDocker(): string | null {
return null;
}

export function dockerDaemonRunning(dockerCommand: string): boolean {
try {
execSync(`${dockerCommand} info`, { stdio: "ignore", timeout: 2000 });
return true;
} catch (error) {
logError(error as string);
return false;
}
}

// Get project root directory
export function getProjectRoot(): string {
return join(__dirname, "..");
Expand Down