Files
AiTools/aitools/Dockerfile
2026-01-07 16:51:12 +03:00

29 lines
583 B
Docker

# Stage 1: Build the application
FROM maven:3.9.11-eclipse-temurin-25 AS build
WORKDIR /app
# Copy pom.xml and download dependencies
COPY pom.xml .
RUN mvn dependency:go-offline
# Copy source code
COPY src ./src
# Build the application
RUN mvn package -DskipTests
# Stage 2: Create the runtime image
FROM eclipse-temurin:25-jdk
WORKDIR /app
# Copy the built JAR file
COPY --from=build /app/target/*.jar app.jar
# Set environment variables
ENV JAVA_OPTS=""
# Expose the application port
EXPOSE 8080
# Run the application
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]