This is a Spring Boot 3 microservice project which uses Spring Cloud Functions and can be compiled with GraalVM and deployed to AWS Lambda.
Before you begin, ensure you have met the following requirements:
- Java 17: Ensure you have Java 17 installed for development.
- Docker: Needed for creating the native image.
- AWS Account: Required for deployment on AWS.
To compile the project for local development using JVM:
mvn clean install
To compile and create a native image, follow these steps:
-
Run the Docker command to start the container:
docker run \ --mount type=bind,source=your_project_path,destination=/project \ -it \ --entrypoint /bin/bash \ marksailes/arm64-al2-graalvm:17-22.3.0
Replace
your_project_path
with the path to your local project. -
Inside the Docker container, compile the native image:
mvn -Pnative native:compile
For detailed instructions on deploying your application to AWS Lambda, you can check this link:
Beat the AWS Lambda Cold Start Time with GraalVM and Spring Boot