From 8e7b2f50ad35f568f2cce05a2633d837c10fb786 Mon Sep 17 00:00:00 2001 From: Kamil Grabowski Date: Wed, 25 Jun 2025 14:16:30 +0200 Subject: [PATCH] parametrize docker image --- Dockerfile | 2 +- docker-compose.yml | 3 +++ src/index.ts | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9720aa4..fd007d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,4 +26,4 @@ RUN npm ci --ignore-scripts --omit-dev USER node -CMD ["node", "dist/index.js", "--host", "0.0.0.0", "--port", "8080", "--transport", "http"] +CMD ["node", "dist/index.js"] diff --git a/docker-compose.yml b/docker-compose.yml index 4550841..301fdf7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,9 @@ services: delay: 5s environment: - BRAVE_API_KEY + - BRAVE_MCP_TRANSPORT=http + - BRAVE_MCP_PORT=8080 + - BRAVE_MCP_HOST=0.0.0.0 init: true ports: - 8080:8080 diff --git a/src/index.ts b/src/index.ts index 3210f92..f542731 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,9 +19,9 @@ if (!BRAVE_API_KEY) { } const program = new Command() - .option("--transport ", "transport type", "http") - .option("--port ", "desired port for HTTP transport", "3000") - .option("--host ", "host address to bind to for HTTP transport", "127.0.0.1") + .option("--transport ", "transport type", process.env.BRAVE_MCP_TRANSPORT ?? "stdio") + .option("--port ", "desired port for HTTP transport", process.env.BRAVE_MCP_PORT ?? "3000") + .option("--host ", "host address to bind to for HTTP transport", process.env.BRAVE_MCP_HOST ?? "0.0.0.0") .allowUnknownOption() .parse(process.argv);