Production Docker image (FrankenPHP + compose + ProductionSeeder)#14
Open
bambamboole wants to merge 2 commits into
Open
Production Docker image (FrankenPHP + compose + ProductionSeeder)#14bambamboole wants to merge 2 commits into
bambamboole wants to merge 2 commits into
Conversation
Multi-stage Dockerfile on serversideup/php:8.4-frankenphp (node assets -> composer vendor -> runtime). Adds `compose-production.yaml` with three services: `app` (FrankenPHP on :8080, runs the init script), `scheduler` (same image, runs supercronic against `crontab`), and `db` (MySQL 8). The container init script at `docker/entrypoint.d/10-init.sh` gates an optional first-boot `wp core install` behind `WP_INSTALL=true`, then always runs `wp acorn migrate --force` and `wp acorn optimize` (config + route + view cache). A new `ProductionSeeder` handles the site-specific setup (permalinks, home + blog pages, WooCommerce activation) and is invoked from the init script only on the first install. All logs stream to docker logs: Caddy access (`CADDY_LOG_FORMAT=json`), Acorn/Laravel (`LOG_CHANNEL=stderr`), supercronic (`-json -passthrough-logs`), and the init script. WordPress `WP_DEBUG_LOG` is already hard-coded false in Bedrock; nothing falls back to files. The image listens on plain HTTP; an external reverse proxy (Coolify is the suggested target) terminates TLS. `.env.production.example` lists the operator-supplied env vars. README has a new "Production deployment" section and the demo home page mentions the Docker setup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
serversideup/php:8.4-frankenphp: multi-stageDockerfile(node assets → composer vendor → runtime) andcompose-production.yamlwith three services —app(FrankenPHP on:8080),scheduler(same image, runssupercronicagainstcrontab),db(MySQL 8).docker/entrypoint.d/10-init.sh) gates an optional first-bootwp core installbehindWP_INSTALL=true, then always runswp acorn migrate --forceandwp acorn optimize(config + route + view cache).ProductionSeederhandles site-specific setup on first install: permalinks (/blog/%postname%/),home+blogpages with correctshow_on_front/page_on_front/page_for_postsoptions, WooCommerce activation.Logging
All logs stream to
docker logs— no file fallbacks:CADDY_LOG_FORMAT=json)LOG_CHANNEL=stderr, using Acorn's stockstderrMonolog channel)-json -passthrough-logsWP_DEBUG_LOGalready hard-codedfalsein Bedrock — nodebug.logfile ever appearsstorage/logs/stays empty at runtimeOperator interface
.env.production.example— 14 vars total:WP_HOME, fourDB_*, eight WP salts,WP_INSTALL. Optional overrides forWP_TITLE/WP_ADMIN_USER/WP_ADMIN_PASSWORD/WP_ADMIN_EMAIL(defaultsadmin / admin / admin@admin.com / WordPress).:8080— intended for an external TLS-terminating reverse proxy. README suggests Coolify as the deployment target.Notes worth flagging
ARG TARGETARCHso the binary matches the build platform (caught on Apple Silicon).mysqliisn't in the serversideup base image — added viainstall-php-extensions mysqli exif.supercronic -no-reapbecause go-reaper conflicts with the base image's s6 zombie reaper.composer install --no-scriptsskips the project'spost-install-cmd(which runsnpm ci+ Playwright); the vendor stage then re-runscomposer dump-autoload --optimize --no-devso Acorn'spost-autoload-dump(package manifest) still fires.WordPressBaselineSeederis unchanged besides one new bullet on the demo home page mentioning the Docker setup.ProductionSeederis a separate file; the splitting of demo vs. baseline content is not part of this PR.Test plan
docker compose --env-file .env.production -f compose-production.yaml up -d --buildbrings updb→app(healthy) →schedulerWP_INSTALL=truetriggerswp core install+ProductionSeeder; idempotent on restartWP_INSTALL=false(or unset) skips install with a clear log messagewp acorn migrateandwp acorn optimizerun on every boot (after install)curl http://localhost:8080/→HTTP 200after installdocker logs appas JSONdocker logs scheduler;wp acorn schedule:runandwp cron event run --due-nowboth reportjob succeededeach minuteProductionSeeder(wp plugin list --status=activeincludeswoocommerce)show_on_front=page,page_on_front=<home>), blog page wired (page_for_posts=<blog>), permalinks/blog/%postname%/storage/logs/stays empty (proves stderr channel is active)🤖 Generated with Claude Code