- CI docker job: QEMU + buildx + --platform linux/amd64 (runners are arm64) - Dockerfile: REGISTRY_TOKEN build arg for @cameleer/design-system npm auth - CI build job: npm auth token for frontend build step - Registry cache for faster builds Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26 lines
856 B
Docker
26 lines
856 B
Docker
# syntax=docker/dockerfile:1
|
|
FROM node:22-alpine AS frontend
|
|
ARG REGISTRY_TOKEN
|
|
WORKDIR /ui
|
|
COPY ui/package.json ui/package-lock.json ui/.npmrc ./
|
|
RUN echo "//gitea.siegeln.net/api/packages/cameleer/npm/:_authToken=${REGISTRY_TOKEN}" >> .npmrc && npm ci
|
|
COPY ui/ .
|
|
RUN npm run build
|
|
|
|
FROM eclipse-temurin:21-jdk-alpine AS build
|
|
WORKDIR /build
|
|
COPY .mvn/ .mvn/
|
|
COPY mvnw pom.xml ./
|
|
RUN --mount=type=cache,target=/root/.m2/repository ./mvnw dependency:go-offline -B
|
|
COPY src/ src/
|
|
COPY --from=frontend /src/main/resources/static/ src/main/resources/static/
|
|
RUN --mount=type=cache,target=/root/.m2/repository ./mvnw package -DskipTests -B
|
|
|
|
FROM eclipse-temurin:21-jre-alpine
|
|
WORKDIR /app
|
|
RUN addgroup -S cameleer && adduser -S cameleer -G cameleer
|
|
COPY --from=build /build/target/*.jar app.jar
|
|
USER cameleer
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|