dchat/Dockerfile
Augusto Dwenger J. b63c89c6e9
All checks were successful
ci/woodpecker/push/java Pipeline was successful
ci/woodpecker/push/oci-image-build Pipeline was successful
build: Set dockerfile syntax to 1
This should include the 1.4 and all later versions.
The latest version is 1.12.0 so there is a lot of fixes that we where
missing.
2024-11-29 20:08:18 +01:00

17 lines
512 B
Docker

# 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