dchat/Dockerfile
Augusto Dwenger J. 18ee28daee Remove old modules
Time for a new beginning :)
2024-10-31 18:37:08 +01:00

21 lines
578 B
Docker

# 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"]