FROM --platform=$BUILDPLATFORM maven:3.9-eclipse-temurin-17 AS build WORKDIR /build # Optional auth for Gitea Maven Registry. The `cameleer/cameleer-common` package # is published publicly, so empty token → anonymous pull (no settings.xml). # Private packages require a non-empty token. ARG REGISTRY_TOKEN="" RUN if [ -n "$REGISTRY_TOKEN" ]; then \ mkdir -p ~/.m2 && \ printf 'giteacameleer%s\n' "$REGISTRY_TOKEN" > ~/.m2/settings.xml; \ fi COPY pom.xml . COPY cameleer-server-core/pom.xml cameleer-server-core/ COPY cameleer-server-app/pom.xml cameleer-server-app/ # Cache deps — only re-downloaded when POMs change RUN mvn dependency:go-offline -B || true COPY . . RUN mvn clean package -DskipTests -U -B FROM eclipse-temurin:17-jre WORKDIR /app COPY --from=build /build/cameleer-server-app/target/cameleer-server-app-*.jar /app/server.jar COPY docker-entrypoint.sh /app/ RUN chmod +x /app/docker-entrypoint.sh EXPOSE 8081 ENV TZ=UTC ENTRYPOINT ["/app/docker-entrypoint.sh"]