
NEXT_PUBLIC Env Variable in Docker: Rebuild, Don't Restart
Next.js replaces a NEXT_PUBLIC env variable with a literal at next build, in server code as well as the browser, so restarting a Docker container with a new value changes nothing.
0%
0000000
0x00
Docker in production: NEXT_PUBLIC values baked in at build time, a layer cache serving a stale page, PHP hidden in images, and a migrate step that hung.

Next.js replaces a NEXT_PUBLIC env variable with a literal at next build, in server code as well as the browser, so restarting a Docker container with a new value changes nothing.

PHP2Shell is fixed in the PHP runtime, so a Docker image needs a newer PHP such as 8.3.36, not an app update. I found PHP inside mailcow and an LMS on my host, and patched both.

payload migrate hangs in CI when a dev-mode marker row waits on a y/N prompt no runner can answer. The documented flag does not reach that command. Deleting one row does.

How one VPS runs Next.js and Payload behind Cloudflare and nginx: the request path, why the build needs a self-hosted runner, migrations on deploy, scheduled publishing, and what is not covered.

A Next.js deploy passed build, migrate, health check and smoke test, yet the live site kept serving the old content. The cause was Docker's layer cache.