This includes the core modules:
- framework: Module including the base framework
- config: Core config library
- assets: Filesystem module
- sqlite3: SQLite3 Module
This is used as a project base for creating a basic framework-only install.
See the recipe plugin page for instructions on how Silverstripe recipes work.
This recipe is configured with SQLite 3 as its in-memory database.
To bypass creating tables and populating them during dev/build
,
set the environment variable with SS_BYPASS_BUILD_DATABASE="1"
Update your environment file .env
with SS_DATABASE_CLASS="ZeroDatabase"
Or serverless.yml
: with SS_DATABASE_CLASS: 'ZeroDatabase'
For testing the basic installation with composer create-project
- Create a file, packages.json (notice the plural form, it is intentional)
- Write the following json string
{
"package": {
"name": "silverstripe/recipe-serverless",
"version": "dev-main",
"source": {
"url": "/var/www/serverless/.git",
"type": "git",
"reference": "main"
}
}
}
- Now create a new project in an empty directory
composer create-project --repository-url=/var/www/serverless/packages.json silverstripe/recipe-serverless . dev-main
- Install CLI command
npm install -g serverless
- Add plugin to serverless
serverless plugin install -n serverless-lift
- Update
serverless.yml
to rename the name of your service -
service: ss-app
is the default value
- Follow instructions for configuring AWS Lambda https://bref.sh/docs/installation/aws-keys.html
- Deploy to AWS Lambda
- Run
serverless deploy
default staging isdev
environment - Or
serverless deploy --stage=dev
- Production
serverless deploy --stage=prod
environment