fix: do not use port exposes on docker compose buildpacks

This commit is contained in:
Andras Bacsai
2024-08-06 11:16:49 +02:00
parent e3c7c615c6
commit 3c98b558f6

View File

@@ -871,9 +871,11 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
$envs->push($env->key.'='.$real_value);
}
// Add PORT if not exists, use the first port as default
if ($this->build_pack !== 'dockercompose') {
if ($this->application->environment_variables_preview->where('key', 'PORT')->isEmpty()) {
$envs->push("PORT={$ports[0]}");
}
}
// Add HOST if not exists
if ($this->application->environment_variables_preview->where('key', 'HOST')->isEmpty()) {
$envs->push('HOST=0.0.0.0');
@@ -915,15 +917,17 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
$envs->push($env->key.'='.$real_value);
}
// Add PORT if not exists, use the first port as default
if ($this->build_pack !== 'dockercompose') {
if ($this->application->environment_variables->where('key', 'PORT')->isEmpty()) {
$envs->push("PORT={$ports[0]}");
}
}
// Add HOST if not exists
if ($this->application->environment_variables->where('key', 'HOST')->isEmpty()) {
$envs->push('HOST=0.0.0.0');
}
}
ray($envs);
if ($envs->isEmpty()) {
$this->env_filename = null;
if ($this->use_build_server) {
@@ -1514,6 +1518,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
{
$this->create_workdir();
$ports = $this->application->main_port();
ray('generate_compose_file: ', $ports);
$onlyPort = null;
if (count($ports) > 0) {
$onlyPort = $ports[0];