dchat/Dockerfile

18 lines
512 B
Text
Raw Permalink Normal View History

# syntax=docker/dockerfile:1
ARG MAVEN_CLI_OPTS="--batch-mode --no-transfer-progress -Dmaven.test.skip"
# Copy all project files
2024-11-27 21:05:05 +01:00
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
2024-11-27 21:05:05 +01:00
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