Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/venveo/serverless-sharp
Serverless image optimizer for S3, Lambda, and Cloudfront
https://github.com/venveo/serverless-sharp
api-gateway aws-lambda cloudfront images imgix lambda s3-bucket seo serverless sharp transformations
Last synced: 3 months ago
JSON representation
Serverless image optimizer for S3, Lambda, and Cloudfront
- Host: GitHub
- URL: https://github.com/venveo/serverless-sharp
- Owner: venveo
- License: mit
- Created: 2019-07-24T18:38:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T20:55:51.000Z (almost 2 years ago)
- Last Synced: 2024-08-02T15:30:24.589Z (6 months ago)
- Topics: api-gateway, aws-lambda, cloudfront, images, imgix, lambda, s3-bucket, seo, serverless, sharp, transformations
- Language: JavaScript
- Homepage: https://venveo.github.io/serverless-sharp/
- Size: 118 MB
- Stars: 167
- Watchers: 8
- Forks: 34
- Open Issues: 36
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Serverless Sharp Image Processor
A solution to dynamically optimize and transform images on the fly, utilizing [Sharp](https://sharp.pixelplumbing.com/en/stable/) and AWS Lambda.[Documentation](https://venveo.github.io/serverless-sharp/index.html)
Brought to you by [Venveo](https://www.venveo.com)
## Who is this for?
This software is for people who want to optimize and run basic transformations (crop, scale, convert, etc) on images from an existing S3
bucket without running computationally expensive processes or servers or paying for expensive third-party services.Serverless Sharp is a drop-in replacement for most essential features of Imgix and costs magnitudes less for
most users.## How does it work?
After deploying this solution, you'll find yourself with a number of AWS resources (all priced based on usage rather
than monthly cost). The most important of which are:
- **AWS Lambda**: Pulls images from your S3 bucket, runs the transforms, and outputs the image from memory
- **API Gateway**: Acts as a public gateway for requests to your Lambda function
- **Cloudfront Distribution**: Caches the responses from your API Gateway so the Lambda function doesn't re-executeOnce deployed, a Cloudfront CDN distribution is generated that is directed to the generated API Gateway. This distribution
ensures the Lambda function does not get run multiple times for the same image request.## Running Locally
This package uses Serverless to allow for local development by simulating API Gateway and Lambda.
1. `npm ci`
2. `cp settings.example.yml settings.yml`
3. Configure settings.yml file
4. Ensure you have AWS CLI configured on your machine with proper access to the S3 bucket you're using in your settings.
5. Run `serverless offline`