2024-11-29 20:08:18 +01:00
|
|
|
# syntax=docker/dockerfile:1
|
2023-07-27 00:18:55 +02:00
|
|
|
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
|
2023-05-16 01:49:44 +02:00
|
|
|
WORKDIR /app
|
2024-02-17 16:22:16 +01:00
|
|
|
COPY . .
|
2023-07-27 00:18:55 +02:00
|
|
|
RUN --mount=type=cache,target=/root/.m2/ \
|
2024-02-17 16:22:16 +01:00
|
|
|
mvn ${MAVEN_CLI_OPTS} package
|
2023-07-27 00:18:55 +02:00
|
|
|
|
|
|
|
# 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
|