2026-03-12 19:01:23 +01:00
|
|
|
FROM --platform=$BUILDPLATFORM maven:3.9-eclipse-temurin-17 AS build
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
2026-04-20 15:52:24 +02:00
|
|
|
# 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 '<settings><servers><server><id>gitea</id><username>cameleer</username><password>%s</password></server></servers></settings>\n' "$REGISTRY_TOKEN" > ~/.m2/settings.xml; \
|
|
|
|
|
fi
|
2026-03-12 19:01:23 +01:00
|
|
|
|
|
|
|
|
COPY pom.xml .
|
2026-04-15 15:28:42 +02:00
|
|
|
COPY cameleer-server-core/pom.xml cameleer-server-core/
|
|
|
|
|
COPY cameleer-server-app/pom.xml cameleer-server-app/
|
2026-03-12 19:01:23 +01:00
|
|
|
# Cache deps — only re-downloaded when POMs change
|
|
|
|
|
RUN mvn dependency:go-offline -B || true
|
|
|
|
|
COPY . .
|
2026-03-25 13:36:07 +01:00
|
|
|
RUN mvn clean package -DskipTests -U -B
|
2026-03-12 19:01:23 +01:00
|
|
|
|
|
|
|
|
FROM eclipse-temurin:17-jre
|
|
|
|
|
WORKDIR /app
|
2026-04-15 15:28:42 +02:00
|
|
|
COPY --from=build /build/cameleer-server-app/target/cameleer-server-app-*.jar /app/server.jar
|
2026-04-11 11:31:26 +02:00
|
|
|
COPY docker-entrypoint.sh /app/
|
|
|
|
|
RUN chmod +x /app/docker-entrypoint.sh
|
2026-03-12 19:01:23 +01:00
|
|
|
|
|
|
|
|
EXPOSE 8081
|
2026-04-01 16:24:23 +02:00
|
|
|
ENV TZ=UTC
|
2026-04-11 11:31:26 +02:00
|
|
|
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|