From 588394a8e64d39665dab4d55519a355883a533f1 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Wed, 13 May 2026 15:52:50 +0800 Subject: [PATCH] fix(compose): stop publishing docreader gRPC port to the host The docreader gRPC service has no authentication or TLS, but the default `ports: ["50051:50051"]` mapping in docker-compose.yml binds to 0.0.0.0, exposing an unauthenticated document parser (with URL fetch capability) on every host interface. The app container reaches docreader through the internal Docker network via `docreader:50051` (the default `DOCREADER_ADDR`), so the host port mapping is not required for normal operation. Replace the `ports` entry with `expose: ["50051"]` so the port is only reachable inside the WeKnora-network. Operators who need to call docreader from the host (for debugging, etc.) can re-add a `ports:` entry in a local override, preferably bound to 127.0.0.1. --- docker-compose.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ada7cef8..59ad3e3f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -188,8 +188,14 @@ services: args: - APT_MIRROR=${APT_MIRROR:-} container_name: WeKnora-docreader - ports: - - "${DOCREADER_PORT:-50051}:50051" + # docreader gRPC ships without auth/TLS and is only consumed by the app + # container over the WeKnora-network (DOCREADER_ADDR defaults to + # docreader:50051), so we don't publish 50051 to the host. `expose` keeps + # the port reachable inside the compose network for documentation only. + # If you need to call docreader from outside the host (e.g. for debugging), + # add a `ports:` entry locally, preferably bound to 127.0.0.1. + expose: + - "50051" volumes: - docreader-tmp:/tmp/docreader environment: