mirror of
https://github.com/weidaoli/betterenderchests.git
synced 2026-03-31 19:32:32 +08:00
29 lines
782 B
Docker
29 lines
782 B
Docker
FROM eclipse-temurin:21-jdk-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
RUN apk add --no-cache curl unzip
|
|
|
|
# Copy project files
|
|
COPY gradle.properties settings.gradle build.gradle ./
|
|
COPY src ./src
|
|
|
|
# Download and setup Gradle
|
|
RUN curl -L -o gradle.zip https://services.gradle.org/distributions/gradle-8.10-bin.zip && \
|
|
unzip -q gradle.zip && \
|
|
rm gradle.zip && \
|
|
mv gradle-8.10 gradle
|
|
|
|
# Create empty gradle home to avoid permission issues
|
|
RUN mkdir -p /root/.gradle
|
|
|
|
# Build the mod
|
|
RUN ./gradle/bin/gradle build --no-daemon -x test || (cat /app/build/reports/problems/problems-report.html 2>/dev/null && exit 1)
|
|
|
|
# Output stage - copy artifacts
|
|
FROM alpine:latest
|
|
WORKDIR /output
|
|
COPY --from=builder /app/build/libs/*.jar ./
|
|
CMD ["ls", "-la", "/output/"]
|