Dockerfile: preserve build dependencies in final image

so as to not break the `entrypoint.sh` script when `REBUILD!=false` and
it calls `make build`
This commit is contained in:
samm81 2023-06-22 17:05:26 -04:00
parent d045e12f6b
commit b7a352aa8a
No known key found for this signature in database

View file

@ -57,6 +57,9 @@ RUN curl -L "https://github.com/gabime/spdlog/archive/refs/tags/v${SPDLOG_VERSIO
# \
# ; fi
###################################
###################################
FROM requirements as builder
ARG GO_TAGS="stablediffusion tts"
@ -75,7 +78,10 @@ RUN make prepare
COPY . .
RUN ESPEAK_DATA=/build/lib/Linux-$(uname -m)/piper_phonemize/lib/espeak-ng-data make build
FROM requirements
###################################
###################################
FROM builder
ARG FFMPEG
@ -87,11 +93,6 @@ RUN if [ "${FFMPEG}" = "true" ]; then \
apt-get install -y ffmpeg \
; fi
WORKDIR /build
COPY --from=builder /build/local-ai ./
COPY entrypoint.sh .
# Define the health check command
HEALTHCHECK --interval=1m --timeout=10m --retries=10 \
CMD curl -f $HEALTHCHECK_ENDPOINT || exit 1