Symfony Demo is a demo web application based on Symfony Framework, Twig and Doctrine libraries.
Zerops recipe for Symfony Demo app includes sessions stored in Redis, and PostgreSQL DB with doctrine 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.
- Symfony running on a load balanced Zerops PHP + Nginx service
- Zerops PostgreSQL 16 service as database
- Zerops KeyDB (Redis) service for session storage
- Setup for Doctrine database migrations
- Logs set up to use syslog and accessible through Zerops GUI
- Utilization of Zerops built-in environment variables system
- Mailpit as SMTP mock server
- 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
modefromNON_HAtoHAin recipe YAML,dbservice section) - Use at least two containers for Symfony service to achieve high reliability and resilience (add
minContainers: 2in recipe YAML,appservice section) - Use production-ready third-party SMTP server instead of Mailpit (change
MAILER_DSNenv variable in./zerops.ymlfile) - Disable public access to Adminer or remove it altogether (remove service
adminerfrom recipe YAML)
If you want to modify your existing Symfony 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 marein/symfony-lock-doctrine-migrations-bundle to your composer.json to enable safe migrations in containerized deployments
- Setup
monolog.syslog_handlerto see logs in Zerops (see our ./config/packages/monolog.yaml) - Setup
session.handler_idto store sessions inside Redis (see our ./config/packages/framework.yaml, we specifically use DB with index0) - We had to move
twbs/bootstrapfromrequire-devtorequirein composer section forcomposer install --no-devto work - We also had to update
symfonycasts/sass-bundletov0.5or newer for sass compilation to work on alpine linux
Need help setting your project up? Join Zerops Discord community.