mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
3.1 KiB
3.1 KiB
| title | short_title | description | keywords | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Serverless Container Framework - Getting Started | Getting Started | Quick start guide for Serverless Container Framework. Learn how to install, configure, and deploy your first containerized application with step-by-step instructions for AWS Lambda and AWS ECS Fargate. |
|
Getting Started
This guide will help you get started with Serverless Container Framework (SCF) by deploying a simple API.
Prerequisites
- Node.js 20.x or later
- AWS Account with administrative access
- Docker installed and running
Installation & Setup
- SCF resides within the Serverless Framework. Install the Serverless Framework CLI globally:
npm install -g serverless
- Configure your AWS credentials using one of these methods. Additional options can be found here.
# 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
Getting Started
- Start with an example project by cloning the repository:
git clone https://github.com/serverless/containers.git
- Navigate to the example project directory, and install any dependencies:
cd example-express/service
npm install
Development
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.
Deployment
Deploy to AWS:
serverless deploy
The initial deployment creates AWS resources (ALB, VPC, etc.) and takes ~5-10 minutes. Subsequent deploys are faster.
Cleanup
Remove your deployment:
# Remove application only
serverless remove
# Remove all AWS resources including VPC
serverless remove --force
Troubleshooting
- Ensure Docker daemon is running for local development
- Check AWS credentials are properly configured using
aws sts get-caller-identity - View detailed logs with
serverless dev --debugorserverless deploy --debug