Get started
or
Taking ownership of theenvironment
Small production environment offers a production-ready setup optimized for moderate throughput.
Knowledge Base
PHP+Nginxapp
zerops-recipe-apps/laravel-minimal-appGotchas
- No
.envfile — Zerops injects environment variables as OS env vars. Creating a.envfile with empty values shadows the OS vars, causingenv()to returnnullfor every key that appears in.enveven if the platform has a value set. - Cache commands in
initCommands, notbuildCommands—config:cache,route:cache, andview:cachebake absolute paths into their cached files. The build container runs at/build/source/while the runtime serves from/var/www/. Caching during build produces paths like/build/source/storage/...that crash at runtime with "directory not found." APP_KEYis project-level — Laravel's encryption key must be shared across containers that read the same database (sessions, encrypted columns); set it at project scope (not per-service or inzerops.yaml envVariables) so the L7 balancer's container shuffle can't break sessions mid-request. The recipe'sAPP_KEY: <@generateRandomString(<32>)>emits a 32-character URL-safe string; Laravel 11-13 accepts this directly as a raw 32-byte AES-256 key. DO NOT add abase64:prefix to the preprocessor output —base64:<@generateRandomString(<32>)>makes Laravel base64-decode the URL-safe chars and yields ~24 bytes, which fails the 32-byte cipher check. If you want the canonicalphp artisan key:generateshape, runssh appdev "cd /var/www && php artisan key:generate --show"after first deploy and set the printedbase64:<44-char>value at project scope; this is a stylistic match, not a runtime fix.- PDO PostgreSQL extension — The
php-nginxbase image includespdo_pgsqlout of the box. NoprepareCommandsorapk addneeded for PostgreSQL connectivity. - Vite manifest missing on dev after fresh deploy — the
devsetup intentionally omitsnpm run buildfrombuildCommandsso the HMR workflow (npm run devvia SSH) stays fast. Any view rendering@vite(...)therefore 500s withVite manifest not found at: /var/www/public/build/manifest.jsonon the first request after azerops_deploy. Fix: runssh appdev 'cd /var/www && npm run build'once after the deploy and beforezerops_verify— SSHFS propagates the manifest into the container without a redeploy. For iterative work,ssh appdev 'cd /var/www && nohup npm run dev > /tmp/vite.log 2>&1 &'dropspublic/build/hotand Laravel routes asset URLs to the dev server. Do NOT addnpm run buildto devbuildCommands— it adds ~20–30 s to everyzcli pushand defeats the HMR-first design.