dchat/Dockerfile

22 lines
578 B
Text
Raw Permalink Normal View History

# syntax=docker/dockerfile:1.4.0
ARG MAVEN_CLI_OPTS="--batch-mode --no-transfer-progress -Dmaven.test.skip"
ARG SETUP_IMAGE=setup-image
ARG TEMURIN_IMAGE_TAG=23-jdk-alpine
# Copy all project files
FROM docker.io/maven:3.9-eclipse-temurin-21 AS setup-image
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=/root/.m2/ \
mvn ${MAVEN_CLI_OPTS} package
FROM ${SETUP_IMAGE} as setup
# Create final bot
FROM docker.io/eclipse-temurin:${TEMURIN_IMAGE_TAG} AS bot
WORKDIR /app
COPY --from=setup /app/bot/target/bot-*-fat.jar /app/bot.jar
CMD ["java", "-jar", "/app/bot.jar"]