From 252ed3b4ec7a7fc7dbc83e5700a5060ecf291311 Mon Sep 17 00:00:00 2001 From: davidtio Date: Sat, 28 Feb 2026 13:59:20 +0800 Subject: [PATCH] Add Dockerfile back to customer repo Dockerfile is customer-owned. docker-compose.yml and clouderized.yaml are operator-generated and live outside the customer repo. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6d3a5f3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# === Build stage === +FROM eclipse-temurin:25-jdk AS build + +RUN apt-get update && apt-get install -y curl gnupg && \ + curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | gpg --dearmor > /etc/apt/trusted.gpg.d/sbt.gpg && \ + echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" > /etc/apt/sources.list.d/sbt.list && \ + apt-get update && apt-get install -y sbt && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY build.sbt . +COPY project/*.sbt project/*.properties project/*.scala project/ +RUN sbt update + +COPY src/ src/ +RUN sbt "set test in assembly := false" assembly + +# === Runtime stage === +FROM eclipse-temurin:25-jre-alpine + +RUN addgroup -S app && adduser -S app -G app +WORKDIR /app + +COPY --from=build --chown=app:app /app/target/scala-3.7.1/demoapp.jar ./demoapp.jar + +USER app +EXPOSE 8080 + +ENV PORT=8080 +ENV JAVA_OPTS="-XX:MaxRAMPercentage=75.0 -XX:+UseContainerSupport -XX:+ExitOnOutOfMemoryError" + +ENTRYPOINT ["sh", "-c", "exec java $JAVA_OPTS -jar demoapp.jar"]