An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(railpack): pin frontend image version via config constant
Andras Bacsaiec71d33f5e5c
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.phpindex 85f438879a..420fe8fd4d 100644--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@ -53,8 +53,6 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueueprivate const RAILPACK_GENERATED_CONFIG_PATH = '.coolify/railpack.generated.json';- private const RAILPACK_FRONTEND_IMAGE_ENV = '${RAILPACK_FRONTEND_IMAGE}';-public $tries = 1;public $timeout = 3600;@@ -2568,11 +2566,12 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue$environmentPrefix = $this->railpack_build_environment_prefix($variables);$secretFlags = $this->railpack_build_secret_flags($variables);+ $frontendImage = 'ghcr.io/railwayapp/railpack-frontend:v'.config('constants.coolify.railpack_version');return 'docker buildx create --name coolify-railpack --driver docker-container 2>/dev/null || true'." && {$environmentPrefix}docker buildx build --builder coolify-railpack"." {$this->addHosts} --network host"- .' --build-arg BUILDKIT_SYNTAX="'.self::RAILPACK_FRONTEND_IMAGE_ENV.'"'+ ." --build-arg BUILDKIT_SYNTAX=\"{$frontendImage}\""." {$cacheArgs}"."{$secretFlags}".' -f /artifacts/railpack-plan.json'diff --git a/config/constants.php b/config/constants.phpindex 867cc22d92..dedafa7d55 100644--- a/config/constants.php+++ b/config/constants.php@@ -5,6 +5,7 @@ return ['version' => '4.1.0','helper_version' => '1.0.13','realtime_version' => '1.0.14',+ 'railpack_version' => '0.22.0','self_hosted' => env('SELF_HOSTED', true),'autoupdate' => env('AUTOUPDATE'),'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),diff --git a/docker/coolify-helper/Dockerfile b/docker/coolify-helper/Dockerfileindex 35798000b3..263c5a311f 100644--- a/docker/coolify-helper/Dockerfile+++ b/docker/coolify-helper/Dockerfile@@ -35,7 +35,6 @@ ARG MISE_VERSIONUSER rootWORKDIR /artifactsENV RAILPACK_VERSION=${RAILPACK_VERSION}-ENV RAILPACK_FRONTEND_IMAGE=ghcr.io/railwayapp/railpack-frontend:v${RAILPACK_VERSION}RUN apk upgrade --no-cache && \apk add --no-cache bash curl git git-lfs openssh-client tar tiniRUN mkdir -p ~/.docker/cli-pluginsdiff --git a/tests/Unit/ApplicationDeploymentRailpackConfigTest.php b/tests/Unit/ApplicationDeploymentRailpackConfigTest.phpindex e3516268c7..5314fa6b8a 100644--- a/tests/Unit/ApplicationDeploymentRailpackConfigTest.php+++ b/tests/Unit/ApplicationDeploymentRailpackConfigTest.php@@ -4,6 +4,9 @@ use App\Exceptions\DeploymentException;use App\Jobs\ApplicationDeploymentJob;use App\Models\Application;use Illuminate\Support\Collection;+use Tests\TestCase;++uses(TestCase::class);class TestableRailpackDeploymentJob extends ApplicationDeploymentJob{@@ -228,5 +231,5 @@ it('builds railpack docker command with matching env and secret flags for all raexpect($command)->toContain('--secret id=RAILPACK_INSTALL_CMD,env=RAILPACK_INSTALL_CMD');expect($command)->toContain('--secret id=SECRET_JSON,env=SECRET_JSON');expect($command)->toContain(' --build-arg secrets-hash=');- expect($command)->toContain('--build-arg BUILDKIT_SYNTAX="${RAILPACK_FRONTEND_IMAGE}"');+ expect($command)->toContain('--build-arg BUILDKIT_SYNTAX="ghcr.io/railwayapp/railpack-frontend:v'.config('constants.coolify.railpack_version').'"');});