initial commit

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2024-10-13 23:24:28 +02:00
commit 4a2466484c
16 changed files with 615 additions and 0 deletions

29
Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
# Stage that builds the application, a prerequisite for the running stage
FROM eclipse-temurin:21-jdk-noble AS build
RUN apt-get update -qq
# Stop running as root at this point
RUN useradd -m app
WORKDIR /usr/src/app/
RUN chown app:app /usr/src/app/
USER app
# Copy all needed project files to a folder
COPY --chown=app ./gradle/ ./gradle
COPY --chown=app ./gradlew ./build.gradle ./settings.gradle ./app.json ./
COPY --chown=app ./src ./src
# Build the production package
RUN ./gradlew clean build -x test
# Running stage: the part that is used for running the application
FROM eclipse-temurin:21-jre-noble
RUN useradd -m app
USER app
COPY --chown=app --from=build /usr/src/app/build/libs/*-SNAPSHOT.jar /usr/app/config.jar
EXPOSE 8080
CMD ["java", "-jar", "/usr/app/config.jar"]