Install the CLI. See the install docs.
Log in:
runway login
Add an SSH key. See key setup, or use the shortcut:
runway local key setup
The following describes the steps necessary to deploy a Symfony-based (version 6.x/LTS) API. If you want to skip the project setup, head over to our Github repository to find the code.
Create the project using Composer:
$ composer create-project symfony/skeleton:"6.1.*" example-symfony-api
Creating a "symfony/skeleton:6.1.*" project at "./example-symfony-api"
Info from https://repo.packagist.org: #StandWithUkraine
Installing symfony/skeleton (v6.1.99)
...The next step is to delete .env and create the app on Runway (this also initializes a git repository, if none exists yet):
$ cd example-symfony-api
$ rm .env
$ runway app create
$ git commit -a -m 'my symfony app'
...The reason why we delete the .env file is because we don’t need them as these settings should be provided by the environment. The next step includes how to achieve this. Besides, runtime secrets should not be committed to version control.
Therefor we disable DotEnv and update the lock:
$ composer config --json extra.runtime.disable_dotenv 'true'
$ composer update --lock
$ git commit -a -m 'Done'
Set the necessary environment variables:
$ runway app config set APP_ENV=production
INFO configuring app "fair-emission"
configure app fair-emission: done
Name Value
APP_ENV production
$ runway app config set APP_SECRET=YOUR-SUPER-SECRET-HERE
INFO configuring app "fair-emission"
configure app fair-emission: done
Name Value
APP_ENV production
APP_SECRET YOUR-SUPER-SECRET-HERErunway app deploy
Run runway app open to see it live, or check the Runway UI. Check runway app logs if something’s off.