fix: use Harbor images with JDK for build
All checks were successful
Build & Deploy Java API / build (push) Successful in 3m52s

This commit is contained in:
gitea-ci
2026-07-22 01:33:27 +08:00
parent 782ae3240d
commit 46393ccf6e

View File

@@ -1,8 +1,21 @@
# Production image - JAR is pre-built locally
FROM eclipse-temurin:17-jre-alpine
# Multi-stage build using local Harbor images
# Stage 1: Build JAR
FROM harbor.cjjhc.top/library/openjdk:25-jdk-slim AS builder
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