Documentation menu

Deploy Symfony on Light Cloud - a PHP container on port 8080, configured through environment variables, with DATABASE_URL for Doctrine.

Deploy Symfony

Symfony is detected from composer.json and runs as a PHP container on port 8080. No Dockerfile needed - one is generated unless the repo has its own.

Configuration#

Symfony already prefers real environment variables over .env files in production - set them as environment variables, per environment:

  • APP_ENV=prod and APP_SECRET.
  • Anything your bundles read (MAILER_DSN, MESSENGER_TRANSPORT_DSN, ...) - the bulk editor takes a whole .env paste.

Containers receive variables at runtime; the image build runs without them, so composer install and cache warmup in the build must not depend on secrets.

Database#

Doctrine reads DATABASE_URL natively - set it from the database's Credentials tab. Run migrations where the database is reachable:

php bin/console doctrine:migrations:migrate --no-interaction

Logs#

Log to stderr (Monolog's php://stderr handler) so entries land in runtime logs.