Skip to content

juniormesquitadandao/serverlastic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverlastic

Elasticity of any web server with docker and aws lambda.

Architecture

How it works?

Transforms your project's docker into the AWS Lambda NodeJS Runtime Interface Client, to initiate a local http and serve requests to the URLs of AWS Lambda functions. It supports any programming language and generates only one: cloudformation, cloudwatch, ecr, s3 and lambda function. Integrates with r53, cloudfront, vpc, rds proxy, codepipeline, codebuild and more.

How to use it?

cd project
  wget -q https://raw.githubusercontent.com/juniormesquitadandao/serverlastic/main/install.sh \
    -O serverlastic.sh && sh serverlastic.sh
  exit
  • Update "sam/devops/server/install.sh" to install all your project's dependencies during docker build.
  • Update "sam/devops/server/server.sh" to start local http when starting new lambda function for testing, local and cloud usage.
  • Update "sam/config.toml" to setup cloudformation, s3 and ecr.
  • Update "sam/template.yaml" for setup function: name, timeout, memory, concurrency, environment variables and docker base image.
  • Configure your project to respond "/samples/[file].[format]" with files of "public/samples/*" for testing.
  • Run tests:
cd project
  ./sam/devops/lambda/build.sh
  ./sam/devops/lambda/install.sh
  ./sam/devops/lambda/test.sh
    # CTRL+C
  exit

Build 01 Build 02 Test 01 Test 02

  • Run local:
cd project
  ./sam/devops/lambda/build.sh
  ./sam/devops/lambda/local.sh
    # CTRL + SHIFT + T
  ./sam/devops/lambda/benchmarking.sh 2 http://dockerhost:3001
    # browser: http://localhost:3001
  exit

Local Server Local Browser Local Benchmarking

  • Run cloud:
cd project
  ./sam/devops/lambda/build.sh
  ./sam/devops/lambda/deploy.sh
    # browser: ServerlasticFunctionUrl.FunctionUrl
  ./sam/devops/lambda/benchmarking.sh 2 ServerlasticFunctionUrl.FunctionUrl
  exit

Deploy 01 Deploy 02 Cloud Browser Cloud Benchmarking Cloud Metrics Cloud Logs

  • Delete resources:
cd project
  ./sam/devops/lambda/delete.sh
  exit

Examples

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published