# Dockerfile for unionflow-server-impl-quarkus
# Used by lionsctl pipeline. Expects `mvn clean package -Pprod` to have produced target/quarkus-app/ (fast-jar).
FROM registry.access.redhat.com/ubi8/openjdk-21:1.21

ENV LANGUAGE='en_US:en'

COPY --chown=1001:1001 target/quarkus-app/lib/      /deployments/lib/
COPY --chown=1001:1001 target/quarkus-app/*.jar     /deployments/
COPY --chown=1001:1001 target/quarkus-app/app/      /deployments/app/
COPY --chown=1001:1001 target/quarkus-app/quarkus/  /deployments/quarkus/

USER 1001

EXPOSE 8080

ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"

HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
  CMD curl -f http://localhost:8080/q/health/live || exit 1

ENTRYPOINT [ "java", "-jar", "/deployments/quarkus-run.jar" ]
