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 KeyDB (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
- AdminerEvo 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
mode
fromNON_HA
toHA
in recipe YAML,db
service section) - Use at least two containers for Nette service to achieve high reliability and resilience (add
minContainers: 2
in recipe YAML,app
service section) - Disable public access to Adminer or remove it altogether (remove service
adminer
from recipe YAML) - Set
APP_ENV
toprod
inenvSecrets
,app
section 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_ENV
env 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
./migrations
folder structure similar to this repo (we moved content ofdatabase.sql
into 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.