Skip to content

feat: configurable port via PORT environment variable#36

Merged
gordonmurray merged 1 commit into
lance-format:mainfrom
gordonmurray:feat/configurable-port
Apr 6, 2026
Merged

feat: configurable port via PORT environment variable#36
gordonmurray merged 1 commit into
lance-format:mainfrom
gordonmurray:feat/configurable-port

Conversation

@gordonmurray
Copy link
Copy Markdown
Collaborator

Summary

  • The listening port was hardcoded to 8080 in the entrypoint script
  • Some orchestrators and reverse proxy setups prefer the container to listen on a specific port
  • Now reads PORT env var (defaults to 8080, fully backwards compatible)

Changes

Two files changed: docker/entrypoint.sh, docker/Dockerfile

  • entrypoint.sh: reads PORT env var with ${PORT:-8080} default, passes it to uvicorn
  • Dockerfile: adds ENV PORT=8080 as the documented default, healthcheck uses ${PORT} so it works with custom ports

Test

# Default port (unchanged behavior)
$ docker run --rm -p 8080:8080 -v ./data:/data:ro lance-data-viewer
Starting Lance Viewer on port 8080...

# Custom port
$ docker run --rm -e PORT=9090 -p 9090:9090 -v ./data:/data:ro lance-data-viewer
Starting Lance Viewer on port 9090...

Both return 200 on /healthz.

Fixes #25

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 lance-format#25
@gordonmurray gordonmurray merged commit 769df9b into lance-format:main Apr 6, 2026
12 checks passed
@gordonmurray gordonmurray deleted the feat/configurable-port branch April 6, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: configurable port via PORT environment variable

1 participant