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 <noreply@anthropic.com>
34 lines
1.0 KiB
Docker
34 lines
1.0 KiB
Docker
# === 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"]
|