-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a78009a
commit 94d4932
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Stage 1: Build stage | ||
FROM maven:3.9.7-amazoncorretto-21 AS build | ||
|
||
# Copy Maven files for dependency resolution | ||
COPY pom.xml ./ | ||
COPY .mvn .mvn | ||
|
||
# Copy application source code | ||
COPY src src | ||
|
||
# Build the project and create the executable JAR | ||
RUN mvn clean install -DskipTests | ||
|
||
# Stage 2: Run stage | ||
FROM amazoncorretto:21 | ||
|
||
# Set working directory | ||
WORKDIR ratelimiter | ||
|
||
# Copy the JAR file from the build stage | ||
COPY --from=build target/*.jar ratelimiter.jar | ||
|
||
# Expose port 1224 | ||
EXPOSE 1224 | ||
|
||
# Set the entrypoint command for running the application | ||
ENTRYPOINT ["java", "-jar", "ratelimiter.jar"] |