docs/scf/getting-started.md
This guide will help you get started with Serverless Container Framework (SCF) by deploying a simple API.
npm install -g serverless
# Option 1: AWS CLI (recommended)
aws configure
# Option 2: Environment variables
export AWS_ACCESS_KEY_ID=your-key-id
export AWS_SECRET_ACCESS_KEY=your-access-key
export AWS_SESSION_TOKEN=your-session-token
git clone https://github.com/serverless/containers.git
cd example-express/service
npm install
Ensure you are within the directory containing the serverless.containers.yml file.
cd example-express
Start the local development environment:
serverless dev
This starts a local emulation of AWS Application Load Balancer at http://localhost:3000. This will forward requests to your containers. Logs, requests and more from your containers will be available in the terminal. Your containers will auto-reload or rebuild on code changes.
Deploy to AWS:
serverless deploy
The initial deployment creates AWS resources (ALB, VPC, etc.) and takes ~5-10 minutes. Subsequent deploys are faster.
Remove your deployment:
# Remove application only
serverless remove
# Remove all AWS resources including VPC
serverless remove --force
aws sts get-caller-identityserverless dev --debug or serverless deploy --debug