fabro/entrypoint.ts
Bryan Helmkamp 129b8b98c4 Add Docker Compose demo setup for local development
Multi-stage Dockerfile builds Rust API binary and bundles the web app
and docs into a single image. docker-compose.demo.yaml orchestrates
the three services (api, web, docs) with a shared entrypoint router.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:32:48 -05:00

44 lines
923 B
TypeScript

const service = process.argv[2];
type ServiceConfig = {
command: string[];
cwd?: string;
};
const services: Record<string, ServiceConfig> = {
api: {
command: ["arc", "serve", "--demo", "--host", "0.0.0.0"],
},
web: {
command: ["bun", "run", "dev", "--host", "0.0.0.0"],
cwd: "apps/arc-web",
},
docs: {
command: ["mintlify", "dev", "--port", "3333", "--host", "0.0.0.0"],
cwd: "docs",
},
};
const validServices = Object.keys(services).join("|");
if (!service) {
console.error(`Usage: docker run arc <${validServices}>`);
process.exit(1);
}
const config = services[service];
if (!config) {
console.error(
`Unknown service: ${service}. Use one of: ${Object.keys(services).join(", ")}`,
);
process.exit(1);
}
const child = Bun.spawn(config.command, {
stdout: "inherit",
stderr: "inherit",
stdin: "inherit",
cwd: config.cwd,
});
process.exit(await child.exited);