Skip to content

fix(frankenphp): copy vendor into the production image and enable the entrypoint - #33

Merged
99linesofcode merged 3 commits into
mainfrom
fix/production-vendor
Oct 18, 2026
Merged

99linesofcode merged 3 commits into
mainfrom
fix/production-vendor

Conversation

@99linesofcode

Copy link
Copy Markdown
Owner

What

The FrankenPHP production image now ships the application's Composer dependencies and runs its entrypoint.

Why

Two defects made the published image unusable:

  • The composer-builder stage ran composer install without first copying composer.json or composer.lock into the stage, and the production stage never copied the resulting vendor/ out of it. vendor/ is gitignored in the application, so COPY . ./ cannot supply it either — the image shipped without dependencies and the app fatally errored on require /app/vendor/autoload.php.
  • The docker-php-entrypoint.sh COPY was commented out, so the entrypoint never ran. Its job is to run artisan deploy commands.

Behavior

  • composer-builder copies composer.json and composer.lock before composer install, so the stage has a manifest to install from and the layer caches when only source changes.
  • production copies vendor/ from composer-builder after COPY . ./.
  • The entrypoint is installed with --chmod=755 and now runs.

The commented-out caddy-builder block and frankenphp binary COPY, and the Caddyfile COPY, are untouched — out of scope.

Done when

  • git diff shows exactly the three changes above.
  • docker build --check -f frankenphp/Dockerfile . completes with no warnings.
  • A local build of the production target succeeds and the image contains /app/vendor/autoload.php (verified by the orchestrator after this PR).

… entrypoint

The composer-builder stage ran composer install without first copying
composer.json or composer.lock into the stage, and the production stage never
copied the resulting vendor/ out of it. vendor/ is gitignored in the
application, so COPY . ./ cannot supply it either, and the published image
shipped without dependencies.

The docker-php-entrypoint COPY was commented out, so the entrypoint never ran.
Its job is to run artisan deploy commands.
The entrypoint called `frankenphp "$@"` where the base image calls
`frankenphp run "$@"`. With the container command `--config ...` this
produced `Error: unknown flag: --config` and the container exited. The defect
was invisible while the entrypoint COPY was commented out.
The application ships a .env.production in its repository, and the production
image now installs it as .env so the container starts configured. The copy is
last so that COPY . ./ cannot clobber it, and the application's .dockerignore
excludes .env.
@99linesofcode
99linesofcode merged commit e920c25 into main Oct 18, 2026
2 checks passed
@99linesofcode
99linesofcode deleted the fix/production-vendor branch October 18, 2026 10:46
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.

1 participant