Skip to content

Commit 769df9b

Browse files
authored
feat: configurable port via PORT environment variable (#36)
The listening port was hardcoded to 8080. While Docker port mapping covers most cases, some orchestrators and reverse proxy setups prefer the container to listen on a specific port. Changes: - entrypoint.sh reads PORT env var with default of 8080 - Dockerfile sets ENV PORT=8080 as the default - Healthcheck uses ${PORT} so it works with custom ports Backwards compatible: default behavior is unchanged (port 8080). Tested with default port (8080) and custom port (PORT=9090), both return 200 on /healthz. Fixes #25
1 parent 61888e5 commit 769df9b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ USER appuser
3333

3434
ENV PATH=/home/appuser/.local/bin:$PATH
3535
ENV DATA_PATH=/data
36+
ENV PORT=8080
3637

3738
EXPOSE 8080
3839

3940
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
40-
CMD curl -fsS http://localhost:8080/healthz || exit 1
41+
CMD curl -fsS http://localhost:${PORT}/healthz || exit 1
4142

4243
# Build arguments for labels (redeclare after FROM)
4344
ARG LANCEDB_VERSION=0.29.2

docker/entrypoint.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ if [ ! -r "$DATA_PATH" ]; then
1111
exit 1
1212
fi
1313

14-
echo "Starting Lance Viewer on port 8080..."
14+
PORT="${PORT:-8080}"
15+
16+
echo "Starting Lance Viewer on port ${PORT}..."
1517
echo "Data path: $DATA_PATH"
1618

17-
exec python -m uvicorn app:app --host 0.0.0.0 --port 8080
19+
exec python -m uvicorn app:app --host 0.0.0.0 --port "${PORT}"

0 commit comments

Comments
 (0)