# syntax=docker/dockerfile:1 ARG MAVEN_CLI_OPTS="--batch-mode --no-transfer-progress -Dmaven.test.skip" # Copy all project files FROM docker.io/maven:3.9-eclipse-temurin-23-alpine AS build WORKDIR /app COPY . . RUN --mount=type=cache,target=/root/.m2/ \ mvn ${MAVEN_CLI_OPTS} package # Create final bot FROM docker.io/alpine:3.20 RUN adduser --system --disabled-password --no-create-home dchat WORKDIR /opt/dchat COPY --from=build /app/bot/target/maven-jlink/default/ . USER dchat CMD /opt/dchat/bin/dchat