Skip to content

Commit bb21d76

Browse files
committed
Enable port mapping for host network
1 parent 9f17f51 commit bb21d76

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ProcessMaker/Models/ScriptDockerNayraTrait.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,13 @@ private function bringUpNayra($restart = false)
130130
if ($status) {
131131
$this->bringUpNayraContainer();
132132
} else {
133-
133+
$isHost = config('app.nayra_docker_network') === 'host';
134+
$portMapping = $isHost ? '-e PORT=' . $this->getNayraPort() . ' ' : '-p ' . $this->getNayraPort() . ':8080 ';
134135
exec($docker . " stop {$instanceName}_nayra 2>&1 || true");
135136
exec($docker . " rm {$instanceName}_nayra 2>&1 || true");
136137
exec(
137138
$docker . ' run -d '
138-
. ($this->getNayraPort() !== 8080 ? '-p ' . $this->getNayraPort() . ':8080 ' : '')
139+
. ($this->getNayraPort() !== 8080 ? $portMapping : '')
139140
. '--name ' . $instanceName . '_nayra '
140141
. (config('app.nayra_docker_network')
141142
? '--network=' . config('app.nayra_docker_network') . ' '

0 commit comments

Comments
 (0)