or
Taking ownership of theenvironment
AI agent environment provides a development space for AI agents to build and version the app. It includes a dev service with the code repository and necessary development tools, a staging service, a low-resource database, a cache store, an object storage, and a search engine.
Knowledge Base
Related platform & services docs
PostgreSQL
Valkey
Meilisearch
PHP+Nginxappdevappstageworkerstage
zerops-recipe-apps/laravel-showcase-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 all services that read the same database (app + worker both need the same key for sessions and encrypted columns). Set it once at project level in Zerops; do not add it per-service or inzerops.yaml envVariables.- PDO PostgreSQL extension โ The
php-nginxbase image includespdo_pgsqlout of the box. NoprepareCommandsorapk addneeded for PostgreSQL connectivity. - Predis over phpredis โ The
php-nginxbase image does not include thephpredisC extension. Use thepredis/predisComposer package and setREDIS_CLIENT=predisto avoid "class Redis not found" errors. - Object storage requires path-style โ Zerops object storage uses MinIO, which requires
AWS_USE_PATH_STYLE_ENDPOINT=true. Without it, the SDK attempts virtual-hosted bucket URLs that MinIO cannot resolve. - 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.
