From e23609fb1b72841cb6fbff24efa3b64532ecad02 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Mon, 30 Sep 2024 23:55:01 +0200 Subject: [PATCH] added Dockerfile Signed-off-by: Stephan Richter --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..985d2c1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM alpine AS build +RUN apk update \ + && apk add openjdk21-jre +RUN apk add bash clang-extra-tools git +ADD . /LightOidc +WORKDIR /LightOidc +RUN VERSION=$(clang-format --version | sed -e "s/.* //g") \ + && sed -i "s|clangFormat(.*).style|clangFormat('$VERSION').style|g" build.gradle \ + && ./gradlew jar \ + && mv *app/build/libs/*.jar /lightoidc.jar + +FROM alpine +RUN apk update \ + && apk add openjdk21-jre +COPY --from=build /lightoidc.jar /opt/lightoidc.jar +RUN adduser -S lightoidc \ + && mkdir /data /home/lightoidc/.config \ + && chown lightoidc /data /home/lightoidc/.config \ + && ln -s /data /home/lightoidc/.config/LightOIDC + +USER lightoidc +ENTRYPOINT java -jar /opt/lightoidc.jar \ No newline at end of file