refactor: no builds in Dockerfiles, CI builds all artifacts
Dockerfiles now only COPY pre-built artifacts: - Dockerfile (SaaS): just COPY target/*.jar, no multi-stage build - ui/sign-in/Dockerfile (Logto): just FROM logto + COPY dist/ - Removed docker/logto.Dockerfile (had node build stage) CI pipeline builds everything: - docker job: builds frontend, JAR, sign-in UI, then packages into images using the simple Dockerfiles - Uses cameleer-build:1 (has node + maven + docker) - build job: also builds sign-in UI for testing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -1,30 +1,7 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Frontend: runs natively on build host
|
||||
FROM --platform=$BUILDPLATFORM 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
|
||||
|
||||
# Maven build: runs natively on build host (no QEMU emulation)
|
||||
FROM --platform=$BUILDPLATFORM eclipse-temurin:21-jdk-alpine AS build
|
||||
WORKDIR /build
|
||||
COPY .mvn/ .mvn/
|
||||
COPY mvnw pom.xml ./
|
||||
# Cache deps — only re-downloaded when POM changes
|
||||
RUN ./mvnw dependency:go-offline -B || true
|
||||
COPY src/ src/
|
||||
COPY --from=frontend /ui/dist/ src/main/resources/static/
|
||||
RUN ./mvnw package -DskipTests -B
|
||||
|
||||
# Runtime: target platform (amd64)
|
||||
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
|
||||
COPY target/*.jar app.jar
|
||||
USER cameleer
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
|
||||
Reference in New Issue
Block a user