I have a function that returns a service:
@func()
serve(@argument({ defaultPath: "/backend" }) source: Directory): Service {
return this.buildEnv(source)
.withServiceBinding("db", this.postgres())
.withEnvVariable("DATABASE_URL", `postgresql://postgres:postgres@db:5432/todo?schema=public`)
.withEnvVariable("PORT", "3001")
.withExposedPort(3001)
.withExec(["bun", "run", "migrate"])
.withEntrypoint(["bun", "run", "dev"])
.asService()
}
I can start the service with:
serve | up
And it starts, with me being able to query it from localhost in another terminal. However, I don't know how to properly stop it. It looks like the Dagger CLI is stuck counting at the asService step and it doesn't respond to any command I type in.
Am I going about this wrong?