Files
dostalgia/Dockerfile
T
Hermes Agent 542c697f8c
Build & Deploy / build-and-deploy (push) Failing after 42s
ci: integrate frontend tests into Maven build + Docker
- Add exec-maven-plugin to pom.xml with 3 npm executions:
  * npm-install (initialize phase)
  * frontend-build (generate-resources phase)
  * frontend-test (test phase)
- Add skipFrontend and skipFrontendTests Maven properties
- Dockerfile now runs npm test in frontend stage
- Dockerfile removes -DskipTests and passes -DskipFrontend=true
  to the Maven stage (frontend already built in its own stage)
2026-06-10 11:53:29 +02:00

30 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
RUN npm test
# ─── 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 -q -DskipFrontend=true
# ─── 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:MinHeapFreeRatio=10", "-XX:MaxHeapFreeRatio=20", "-jar", "quarkus-run.jar"]