This project demonstrates how a simple Flask API backed by DynamoDB can be deployed to AWS Lambda using the Serverless Framework.
- Copy the example environment file:
cp env.example .env
- Edit
.env
and add your environment variables. - Load the variables into your shell:
source .env
- Build the Docker image:
docker compose build
- Start the container:
docker compose up -d
- The API will be available at:
http://127.0.0.1:${PORT}/home
To enter the container shell:
docker compose exec app bash
To deploy the API using Serverless Framework, run:
serverless deploy
- Flask – Web framework for Python
- DynamoDB - Amazon NoSQL database service
- Docker – Containerization for local development
- Serverless Framework – Deployment automation for AWS Lambda
- AWS Lambda – Serverless compute service
This project is licensed under the MIT License.
- If you need to update environment variables, update
.env
and restart the container with:docker compose up -d --build
- For debugging deployment issues, check logs with:
serverless logs -f function_name