| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Serverless Container Framework (SCF) streamlines the development and deployment of containerized applications on AWS Lambda and/or AWS Fargate ECS.
This example demonstrates how to build and deploy a React application using SCF. The application is bundled using esbuild and optimized for production deployments on AWS Fargate ECS.
Docker:
Install and start Docker Desktop. (Get Docker)
Serverless Framework:
Install globally:
npm i -g serverlessNode.js & npm:
Ensure you have a recent Node.js LTS version installed.
AWS Credentials:
Set up your AWS credentials (via environment variables or profiles) for SCF deployment.
The SCF configuration is defined in the serverless.containers.yml file at the project root:
name: react
deployment:
type: awsApi@1.0
containers:
service:
src: ./service
routing:
pathPattern: /*
pathHealthCheck: /health
environment:
HELLO: world
compute:
# awsLambda is not recommended for this React app.
# The bundled app may exceed AWS Lambda's request/response size limits.
type: awsFargateEcsA typical project structure for this React example:
example-react/
├── serverless.containers.yml # SCF configuration file
└── service/
├── package.json # Project configuration and dependencies
├── public/ # Static assets (HTML, CSS, images, etc.)
├── server.js # Server entrypoint for serving the React app
└── src/
├── index.jsx # React application entrypoint
└── (other components) # React components and logic
For local development, use Serverless Container Framework's development mode:
serverless devThis will automatically start the development environment with hot reloading and AWS-like routing.
Deploy your React application to AWS by running:
serverless deploySCF takes care of building the container image (using the provided Dockerfile) and provisioning the necessary resources.
To remove the deployed AWS resources, run:
serverless remove --force --all| Back | FazBrowse Home | New Git URL |