fix: use Harbor images with JDK for build
All checks were successful
Build & Deploy Java API / build (push) Successful in 3m52s
All checks were successful
Build & Deploy Java API / build (push) Successful in 3m52s
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -1,8 +1,21 @@
|
|||||||
# Production image - JAR is pre-built locally
|
# Multi-stage build using local Harbor images
|
||||||
FROM eclipse-temurin:17-jre-alpine
|
# Stage 1: Build JAR
|
||||||
|
FROM harbor.cjjhc.top/library/openjdk:25-jdk-slim AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY target/*.jar app.jar
|
|
||||||
|
# Install Maven
|
||||||
|
RUN apt-get update && apt-get install -y maven && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY pom.xml .
|
||||||
|
COPY src ./src
|
||||||
|
RUN mvn clean package -DskipTests
|
||||||
|
|
||||||
|
# Stage 2: Production image
|
||||||
|
FROM harbor.cjjhc.top/library/eclipse-temurin:25-jre-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/target/*.jar app.jar
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user