Skip to content

Commit

Permalink
Task 9 : Define Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapter1990 committed Jun 28, 2024
1 parent a78009a commit 94d4932
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
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"]

0 comments on commit 94d4932

Please sign in to comment.