File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -335,9 +335,12 @@ function Start-Htmx {
335
335
if (-not $myParams [' ServerUrl' ]) {
336
336
$ServerUrl = $myParams [' ServerUrl' ] =
337
337
if (-not $ServerUrl ) {
338
- # If we are on unix, and a port has not been set, we will use port 80.
339
- if ($PSVersionTable.Platform -eq ' Unix' ) {
340
- if (-not $port ) { $port = 80 }
338
+ # If we are on unix, and a port has not been set,
339
+ # and an environment variable indicates we are in a container, we will use port 80.
340
+ if ($PSVersionTable.Platform -eq ' Unix' -and (
341
+ Get-ChildItem env: | Where-Object Name -Match InContainer
342
+ )) {
343
+ if (-not $port ) { $port = 80 }
341
344
" http://*:$port /"
342
345
} else {
343
346
# If we are on Windows, we will use a random port between 4kb and 32kb.
You can’t perform that action at this time.
0 commit comments