The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as Docker from "@alchemy.run/docker"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as HttpServerResponse from "effect/http/HttpServerResponse"; |
| 4 | import { SERVICE_EXTERNAL_PORT } from "./service.ts"; |
| 5 | |
| 6 | /** |
| 7 | * A non-code change to `./service-v2.ts`: it bundles the same `main`, so the |
| 8 | * content hash is unchanged, and only `replicas` differs. Deploying it after |
| 9 | * `./service-v2.ts` updates the service without building a new image. |
| 10 | */ |
| 11 | export default class TestServiceV2Scaled extends Docker.Service<TestServiceV2Scaled>()( |
| 12 | "DockerPlatformService", |
| 13 | { |
| 14 | main: `${import.meta.dirname}/service-v2.ts`, |
| 15 | port: 3000, |
| 16 | ports: [{ external: SERVICE_EXTERNAL_PORT, internal: 3000 }], |
| 17 | replicas: 2, |
| 18 | }, |
| 19 | // Never runs: the bundle is built from `./service-v2.ts`. |
| 20 | Effect.succeed({ fetch: Effect.succeed(HttpServerResponse.text("unused")) }), |
| 21 | ) {} |