From 9e8f417f9007d3c736b25972a6391ae5da3f65b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 21 Jul 2025 13:56:54 +0200 Subject: [PATCH] make Docker Compose use PORT for --allow-net flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we get error like this: error: Uncaught (in promise) PermissionDenied: Requires net access to "0.0.0.0:8900", run again with the --allow-net flag Signed-off-by: Jakub SokoĊ‚owski --- Dockerfile | 2 ++ docker-compose.yml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1a75d7c..ba76dec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,6 @@ RUN deno cache deps.ts COPY . . RUN deno cache main.ts +ENV PORT=8080 + CMD ["run", "--allow-env", "--allow-net=:8080,discord.com", "main.ts"] diff --git a/docker-compose.yml b/docker-compose.yml index 16cc78e..c9ab6d0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,12 @@ services: env_file: .env environment: HOSTNAME: "0.0.0.0" + ADDR: "${ADDR:-127.0.0.1}" PORT: "${PORT:-8080}" ports: - '${ADDR:-127.0.0.1}:${PORT:-8080}:${PORT:-8080}' + command: + - run + - --allow-env + - --allow-net=:${PORT},discord.com + - main.ts