feat: add support for user-configurable build methods and custom Dockerfile paths#2
Draft
freddyjaoko wants to merge 1 commit into
Draft
feat: add support for user-configurable build methods and custom Dockerfile paths#2freddyjaoko wants to merge 1 commit into
freddyjaoko wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Dockerfile build path alongside Railpack
Closes #1
Aeroplane previously only supported building via Railpack (BuildKit LLB). This PR adds a fully separate Dockerfile build path using
docker build, so repos that ship their ownDockerfilenow work without any workarounds.What changed
Auto-detection
At deploy time, after the repo is cloned, Aeroplane checks for a
Dockerfilein the app directory. If one is found and the service is still set torailpack, the build automatically switches todockerfilemode — and that discovery is persisted to the database so the Settings tab reflects it on the next load.Two build paths, one container runtime
Both paths produce the same tagged Docker image, so zero-downtime rollout, Caddy hot-reload, health probing, worker mode, and static site export are completely unchanged.
Build-arg passthrough
When building with a Dockerfile, service env vars are forwarded as
--build-argflags soARGdeclarations in the Dockerfile can pick them up (same vars Railpack would receive).BuildKit reuse
If
BUILDKIT_HOSTpoints to a TCP address (Aeroplane's embedded BuildKit daemon),docker buildwill use it viaBUILDKIT_HOSTenv, keeping caching consistent.Database migration
Two new columns are added to the
projectstable with safeALTER TABLE … ADD COLUMNmigrations (no destructive changes):build_methodTEXT'railpack'dockerfile_pathTEXT'Dockerfile'All existing services continue to use Railpack unless a Dockerfile is detected.
Settings UI
A Build method toggle appears in the service Settings tab for Git-backed services:
docker build, bypasses Railpack entirely; exposes a Dockerfile path input for non-standard locations (e.g.docker/Dockerfile.prod)A hint in Railpack mode explains the auto-detection behaviour.
What's explicitly NOT supported
Railpack does not support Dockerfiles internally (it uses BuildKit LLB directly). The two paths are mutually exclusive by design — switching to Dockerfile mode fully bypasses Railpack.
Testing checklist
Dockerfileat root auto-switches on first deployDockerfileuses Railpack as beforedockerfilein Settings is persisted and respecteddockerfilePath(e.g.infra/Dockerfile) is respectedARGdeclarations in the Dockerfilerailpack)Summary by cubic
Adds user-selectable build methods (
railpackor Dockerfile) with support for custom Dockerfile paths and automatic detection at deploy time. Repos with aDockerfilenow build viadocker buildwhile keeping the same image, rollout, and runtime behavior.New Features
Dockerfileon deploy; switch todockerfilemode and persist it so Settings reflects the change.Dockerfilepath input; hint explains auto-detect when inrailpackmode.docker buildwithDOCKER_BUILDKIT=1; reuse external BuildKit whenBUILDKIT_HOSTis a TCP address.--build-argsoARGvalues work in the Dockerfile.buildMethodanddockerfilePathto service payloads; addbuild_methodanddockerfile_pathcolumns and defaults.Migration
railpackwithdockerfilePath=Dockerfile.railpack; if aDockerfileis present, the next deploy auto-switches and persists the mode.dockerfilePathin Settings; if the path is invalid, the build will fail with guidance to update the path or switch back torailpack.Written for commit fc3aa4a. Summary will update on new commits.