added Dockerfile, preparing for distribution

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-01-03 14:14:51 +01:00
parent 78258860c1
commit 7991f8bf0c
2 changed files with 32 additions and 1 deletions

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM alpine AS build
RUN apk update \
&& apk add openjdk21-jre
RUN apk add bash clang-extra-tools git
ADD . /OpenCloudCal
WORKDIR /OpenCloudCal
RUN VERSION=$(clang-format --version | sed -e "s/.* //g") \
&& sed -i "s|clangFormat(.*).style|clangFormat(\"$VERSION\").style|g" build.gradle.kts \
&& ./gradlew jar
RUN mv *app/build/distributions/*.zip /occ.zip
FROM alpine
RUN apk update \
&& apk add openjdk21-jre
COPY --from=build /occ.zip /opt/occ.zip
RUN cd /opt && unzip occ.zip && ls -al
RUN adduser -S occ \
&& mkdir /data /home/occ/.config \
&& chown occ /data /home/occ/.config \
&& ln -s /data /home/occ/.config
USER occ
ENTRYPOINT java -jar /opt/lightoidc.jar