fix: build JAR locally, use minimal JRE image
Some checks failed
Build & Deploy Java API / build (push) Failing after 40s
Some checks failed
Build & Deploy Java API / build (push) Failing after 40s
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,16 +1,8 @@
|
||||
# Multi-stage build with Chinese registry mirror
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/chenxipan/maven:3.9-eclipse-temurin-17 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY pom.xml .
|
||||
COPY src ./src
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# Production stage
|
||||
# Production image - JAR is pre-built locally
|
||||
FROM eclipse-temurin:17-jre-alpine
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/target/*.jar app.jar
|
||||
COPY target/*.jar app.jar
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
|
||||
Reference in New Issue
Block a user