From 0bf7c5c1690d8fb371a7b0cd5a59b350bd1c2424 Mon Sep 17 00:00:00 2001 From: Tomasz Pietrek Date: Thu, 5 Oct 2023 16:50:35 +0200 Subject: [PATCH] Add Dockerfile Signed-off-by: Tomasz Pietrek --- bin/docker/Dockerfile | 10 ++++++++++ bin/os_compatibility.ts | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 bin/docker/Dockerfile diff --git a/bin/docker/Dockerfile b/bin/docker/Dockerfile new file mode 100644 index 00000000..4206cb52 --- /dev/null +++ b/bin/docker/Dockerfile @@ -0,0 +1,10 @@ +FROM denoland/deno:1.29.1 + +# Set the working directory in the container to /app +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app +ENV NATS_URL=localhost:4222 +# Run the specified deno command +CMD ["run", "--allow-env", "--allow-net", "./bin/os_compatibility.ts"] diff --git a/bin/os_compatibility.ts b/bin/os_compatibility.ts index 87c76a62..7108b6ce 100644 --- a/bin/os_compatibility.ts +++ b/bin/os_compatibility.ts @@ -16,7 +16,8 @@ import { connect, millis, Msg } from "../src/mod.ts"; import { sha256 } from "https://denopkg.com/chiefbiiko/sha256@v1.0.0/mod.ts"; -const nc = await connect({ servers: "localhost:4222" }); +const servers = Deno.env.get("NATS_URL") || "nats://localhost:4222"; +const nc = await connect({ servers }); const js = nc.jetstream(); console.log("connected");