afwolfe / java-lambda-test

A small project to experiment with deploying Java applications to AWS Lambda with Docker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java-lambda-test

A small project to experiment with deploying Java applications to AWS Lambda with Docker.

Overview

The project is built with:

  • Docker
  • Java 11
  • Gradle

The project will build and deploy a fat/uber JAR to the Lambda Docker container.

Usage

Included are a pair of basic shell scripts, build.sh and run.sh which will build and start the container locally:

  1. Build the Docker image:
    • docker build -t java-lambda-test:latest -f Dockerfile .
    • Use Dockerfile.dev to just copy the locally built jar into the image for faster testing.
  2. Run the Docker image:
    • docker run -p 9000:8080 java-lambda-test:latest
  3. Use an API client or curl to invoke the Lambda:
    • curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"name":"afwolfe", "id":1}'

Acknowledgements/Resources

About

A small project to experiment with deploying Java applications to AWS Lambda with Docker.

License:MIT License


Languages

Language:Java 74.4%Language:Dockerfile 16.3%Language:Shell 9.3%