Nette QuickStart is a very simple web application based on Nette Framework. Zerops recipe for Nette QuickStart includes session and cache stored in Redis, and PostgreSQL DB with Nextras migrations.
You can either click the deploy button to deploy directly on Zerops, or manually copy the import yaml to the import dialog in the Zerops app.
- Nette running on a load balanced Zerops PHP + Nginx service
- Zerops PostgreSQL 16 service as database
- Zerops Valkey (Redis) service for session and cache
- Setup for Nextras database migrations with automatic admin user creation
- Logs set up to use syslog and accessible through Zerops GUI
- Utilization of Zerops built-in environment variables system
- Adminer for quick database management tool
Base of the recipe is ready for production, the difference comes down to:
- Use highly available version of the PostgreSQL database (change
typefrompostgresql:single@16topostgresql:ha@16in recipe YAML,dbservice section) - Switch to
oltp-productionprofile for the PostgreSQL database - Use at least two containers for Nette service to achieve high reliability and resilience (add
minContainers: 2in recipe YAML,appservice section) - Disable public access to Adminer or remove it altogether (remove service
adminerfrom recipe YAML) - Set
APP_ENVtoprodinenvSecrets,appsection of import YAML
If you want to modify your existing Nette app to efficiently run on Zerops, these are the general steps we took:
- Add zerops.yml to your repository, our example includes idempotent migrations, caching, and optimized build process
- Add
$configurator->addDynamicParameters(['env' => getenv()]);to your ./app/Bootstrap.php file to use env variables in your neon configuration files - Set debug mode according to
APP_ENVenv variable in your ./app/Bootstrap.php file - Add nette/redis to your composer.json to store sessions in Redis
- configure it according to our ./config/common.neon file
- Add nette/monolog to your composer.json to log into the syslog
- utilize the following handler:
Monolog\Handler\SyslogHandler(app)(see our ./config/common.neon)
- utilize the following handler:
- Add nextras/migrations to your composer.json to utilize automated DB migrations
- create
./migrationsfolder structure similar to this repo (we moved content ofdatabase.sqlinto it) - SQLite (
./data/blog.sqlite) was replaced by PostgreSQL database container
- create
Admin login for this recipe is admin with automatically generated password,
which can be found under ADMIN_PASSWORD name in Zerops Environment variables section of app service.
Need help setting your project up? Join Zerops Discord community.