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.
This commit is contained in:
wizardchen
2026-05-13 15:52:50 +08:00
committed by lyingbug
parent 80bd268862
commit 588394a8e6
+8 -2
View File
@@ -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: