Files
floci/Dockerfile.native
T
Matej Šnuderl 8149c21c9c feat: add HEALTHCHECK to all Dockerfiles (#328)
Adds Docker HEALTHCHECK instruction to all four Dockerfiles so
orchestration tools can detect readiness. Installs curl where needed
and uses the existing /_floci/health endpoint.
2026-04-11 09:46:23 -05:00

39 lines
1.0 KiB
Docker

# Stage 1: Build native executable
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-24 AS build
USER root
WORKDIR /app
# Install Maven 3.9.x (system Maven is too old for Quarkus 3.31)
RUN curl -fsSL https://archive.apache.org/dist/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz | tar xz -C /opt \
&& ln -sf /opt/apache-maven-3.9.12/bin/mvn /usr/local/bin/mvn
COPY pom.xml .
RUN mvn dependency:go-offline -B
COPY src ./src
RUN mvn clean package -Dnative -DskipTests -B
# Stage 2: Minimal runtime
FROM quay.io/quarkus/quarkus-micro-image:2.0
USER root
WORKDIR /app
RUN mkdir -p /app/data \
&& chown -R 1001:root /app \
&& chmod -R g+rwX /app
VOLUME /app/data
EXPOSE 4566
HEALTHCHECK --interval=5s --timeout=3s --retries=5 \
CMD bash -c 'echo -e "GET /_floci/health HTTP/1.0\r\nHost: localhost\r\n\r\n" > /dev/tcp/localhost/4566' || exit 1
ARG VERSION=latest
ENV FLOCI_VERSION=${VERSION}
COPY --from=build /app/target/*-runner /app/application
RUN chmod +x /app/application
USER 1001
ENTRYPOINT ["/app/application"]