Skip to content

zeropsio/recipe-symfony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zerops x Symfony

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.

symfony


Deploy on Zerops

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.

Deploy on Zerops


Recipe features

  • 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

Production vs. development

Base of the recipe is ready for production, the difference comes down to:

  • Use highly available version of the PostgreSQL database (change mode from NON_HA to HA in recipe YAML, db service section)
  • Use at least two containers for Symfony service to achieve high reliability and resilience (add minContainers: 2 in recipe YAML, app service section)
  • Use production-ready third-party SMTP server instead of Mailpit (change MAILER_DSN env variable in ./zerops.yml file)
  • Disable public access to Adminer or remove it altogether (remove service adminer from recipe YAML)

Changes made over the default installation

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_handler to see logs in Zerops (see our ./config/packages/monolog.yaml)
  • Setup session.handler_id to store sessions inside Redis (see our ./config/packages/framework.yaml, we specifically use DB with index 0)
  • We had to move twbs/bootstrap from require-dev to require in composer section for composer install --no-dev to work
  • We also had to update symfonycasts/sass-bundle to v0.5 or newer for sass compilation to work on alpine linux


Need help setting your project up? Join Zerops Discord community.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published