Skip to content

feat(build): support runtimeInstallCommand in generated builds (#1773) - #1899

Open
YK-03 wants to merge 1 commit into
oblien:mainfrom
YK-03:feat/1773-runtime-install-command
Open

YK-03 wants to merge 1 commit into
oblien:mainfrom
YK-03:feat/1773-runtime-install-command

Conversation

@YK-03

@YK-03 YK-03 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #1773.

Problem

Applications utilizing generated Docker recipes (e.g. Laravel / PHP requiring PostgreSQL client pg_dump for spatie/laravel-backup, ImageMagick, or CLI utilities) run as an unprivileged user (e.g., www-data or rails) at runtime. System packages installed during the builder or asset stages are not retained in the final runtime container image, and containers lack root privileges at startup to install system packages on boot.

Solution

Added support for an optional runtimeInstallCommand in generated builds:

  • packages/adapters:
    • Added runtimeInstallCommand?: string to BuildConfig.
    • In docker-recipes/php.ts: Executes RUN <runtimeInstallCommand> as root after PHP extension installation and prior to copying the application code and dropping privileges to www-data.
    • In docker-recipes/ruby.ts & generic.ts: Executes RUN <runtimeInstallCommand> in the runtime stage prior to switching to non-root users.
    • In docker-recipes/cache.ts: Included runtimeInstallCommand in build cache key calculation.
  • packages/contracts: Added runtimeInstallCommand to CreateProjectBody (and transitively UpdateProjectBody) and MonorepoSubAppFieldsSchema.
  • packages/db: Added runtimeInstallCommand text column to the project table with migration 0241_runtime_install_command.sql.
  • packages/platform: Persisted runtimeInstallCommand in createProject and updateProject, included it in deployment build snapshots, and passed it to createBuildConfig.
  • apps/dashboard: Added runtimeInstallCommand to project option types and application settings form.
  • Tests: Added test suites verifying runtime stage placement in generated Dockerfiles across recipes and schema validation.

…n#1773)

Signed-off-by: Yash Kaushik <yash005kaushik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Install system packages in the runtime image of generated builds

1 participant