nakato53/symfony-vercel-bundle

Install vercel runtime for Symfony

0.5 2024-02-07 17:22 UTC

This package is auto-updated.

Last update: 2025-06-07 21:08:07 UTC


README

A Symfony Bundle, that help you to configure your Symfony project running on Vercel

Installation

Use composer to install Vercel Symfony Bundle.

composer require nakato53/symfony-vercel-bundle --dev

Usage

php bin/console vercel:install

This command will setup all required configuration for you. It will create :

  • vercel.json -> configuration for the runtime
  • api folder -> folder used by vercel to expose the application
  • composer.json scripts -> add vercels scripts

Customize

vercel.json

In this file you should add your environnement variables. Becareful, this file is part of your git repository, you should not expose any important datas. Use your Vercel project settings to handle thoses variables.

composer.json

In the scripts/vercel parts, you can add any script you need to use during the deployment of your application. You can use this part to run migrations.

If using assetmapper, you should add this script to compile your assets :

"@php bin\/console asset-map:compile --env=prod"

Deploy

You just have to create a project on Vercel, and link it to your git repository. On each push , you will trigger an automatic deployment