e9c4d963ad
Build & Deploy / build-and-deploy (push) Failing after 49s
-XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:G1HeapUncommitPercent=5 After large game uploads, the JVM committed heap stays high. These flags tell G1GC to release free heap pages back to the OS after GC cycles, so Docker memory usage drops back toward baseline instead of staying at peak.
29 lines
1.1 KiB
Docker
29 lines
1.1 KiB
Docker
# Dostalgia — Quarkus multi-stage build
|
|
|
|
# ─── 1. Build frontend ───────────────────────────
|
|
FROM node:20-alpine AS frontend
|
|
WORKDIR /build
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
RUN npm ci 2>/dev/null || npm install --legacy-peer-deps
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
# ─── 2. Build Quarkus app ────────────────────────
|
|
FROM maven:3-eclipse-temurin-21-alpine AS build
|
|
WORKDIR /build
|
|
COPY pom.xml ./
|
|
COPY src ./src
|
|
# Copy the built frontend into the source tree so maven-resources-plugin picks it up
|
|
COPY --from=frontend /build/dist ./frontend/dist/
|
|
RUN mvn package -DskipTests -q
|
|
|
|
# ─── 3. Runtime ──────────────────────────────────
|
|
FROM eclipse-temurin:21-jre-alpine
|
|
WORKDIR /app
|
|
# Quarkus uber-jar layout
|
|
COPY --from=build /build/target/quarkus-app/ /app/
|
|
EXPOSE 8765
|
|
VOLUME /data
|
|
ENV DOSTALGIA_DATA_DIR=/data
|
|
ENTRYPOINT ["java", "-XX:+UseG1GC", "-XX:MinHeapFreeRatio=10", "-XX:MaxHeapFreeRatio=20", "-XX:G1HeapUncommitPercent=5", "-jar", "quarkus-run.jar"]
|