Browse Source

added Dockerfile

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
devel
Stephan Richter 2 months ago
parent
commit
e23609fb1b
  1. 22
      Dockerfile

22
Dockerfile

@ -0,0 +1,22 @@ @@ -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
Loading…
Cancel
Save