Skip to content

Commit

Permalink
Consolidate image and update healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
bdhoine committed Dec 10, 2024
1 parent bccccb0 commit 8be0c02
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 8be0c02

Please sign in to comment.