From 49ef4daea4480d4df408d3420da0cecb440b4598 Mon Sep 17 00:00:00 2001 From: AuthorTom <63931206+authorTom@users.noreply.github.com> Date: Sat, 25 Jul 2026 18:29:19 +0100 Subject: [PATCH] feat: make host port configurable via HOST_PORT in .env Use ${HOST_PORT:-3000} for the host side of the port mapping and document HOST_PORT in .env.example. Container-internal port stays 3000 so the image healthcheck is unaffected. Defaults to 3000 when unset. Co-Authored-By: Claude Opus 4.8 --- .env.example | 5 +++++ compose.yaml | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index f9b81ff..c0279f5 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,11 @@ # forced to re-password in the browser at first sign-in. There is no secret to # put in this file for that -- set it in the app after the first `up -d`. +# Host port SimHub is reachable on, e.g. http://:8080. This maps to the +# container's fixed internal port 3000, so you can change it freely without +# touching the healthcheck. Defaults to 3000 if unset. +HOST_PORT=3000 + # Runtime environment. Leave as "production" for real deployments. NODE_ENV=production diff --git a/compose.yaml b/compose.yaml index 170a378..e8204d3 100644 --- a/compose.yaml +++ b/compose.yaml @@ -29,9 +29,11 @@ services: init: true ports: - # "host:container" -- change the LEFT number to serve on a different host - # port. Quoted so YAML never reinterprets it (e.g. 22:22 as base-60). - - "3000:3000" + # "host:container". Set HOST_PORT in .env to serve on a different host + # port (defaults to 3000); the container port stays 3000 to match the + # image's healthcheck. Quoted so YAML never reinterprets it (e.g. 22:22 + # as base-60). + - "${HOST_PORT:-3000}:3000" environment: # Production defaults. Override in .env if needed.