From 8be0c02caad1b1fcb871cdd1e0ec687decf3e509 Mon Sep 17 00:00:00 2001 From: Barry d'Hoine Date: Tue, 10 Dec 2024 22:39:27 +0100 Subject: [PATCH] Consolidate image and update healthcheck --- Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1a254c5..2fa48c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,34 @@ -FROM azul/zulu-openjdk:11-jre-headless AS installer +FROM azul/zulu-openjdk:11-jre-headless -ARG AEMC_VERSION=2.0.3 ARG TARGETOS=linux ARG TARGETARCH=amd64 -RUN apt-get update &&\ - apt-get install -y --no-install-recommends curl - -RUN curl -L https://github.com/wttech/aemc/releases/download/v${AEMC_VERSION}/aemc-cli_${TARGETOS}_${TARGETARCH}.tar.gz | tar -xz -C /usr/local/bin - -FROM azul/zulu-openjdk:11-jre-headless - +ARG AEMC_VERSION=2.0.3 ARG RUNMODE=author ARG PORT=4502 ENV RUNMODE=${RUNMODE} +ENV PORT=${PORT} ENV AEM_VENDOR_JAVA_HOME_DIR=$JAVA_HOME -COPY --from=installer /usr/local/bin/aem /usr/local/bin/aem - EXPOSE ${PORT} WORKDIR /opt +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl &&\ + apt-get clean &&\ + rm -rf /var/cache/apk/* &&\ + curl -L https://github.com/wttech/aemc/releases/download/v${AEMC_VERSION}/aemc-cli_${TARGETOS}_${TARGETARCH}.tar.gz | tar -xz -C /usr/local/bin + COPY aem-sdk-artifacts/aem-sdk-*.zip aem/home/lib/ COPY aem/default/etc/aem.yml aem/default/etc/aem.yml RUN aem instance --instance-${RUNMODE} launch && aem instance down -HEALTHCHECK CMD /usr/local/bin/aem instance --instance-${RUNMODE} await - COPY aem-start.sh /usr/local/bin/aem-start RUN chmod +x /usr/local/bin/aem-start +HEALTHCHECK CMD /usr/bin/curl -f http://localhost:${PORT}/systemready + CMD ["/usr/local/bin/aem-start"]