|
ARG GRADIO_PORT |
|
ARG MODEL_NAME |
|
ARG QUANTIZATION |
|
|
|
FROM ghcr.io/huggingface/text-generation-inference:latest |
|
|
|
ARG GRADIO_PORT |
|
ARG MODEL_NAME |
|
ARG QUANTIZATION |
|
|
|
ENV TZ=Europe/Paris \ |
|
PORT=3000 |
|
|
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ |
|
gnupg \ |
|
curl \ |
|
gettext && \ |
|
rm -rf /var/lib/apt/lists/* |
|
COPY entrypoint.sh.template entrypoint.sh.template |
|
|
|
|
|
RUN echo $QUANTIZATION |
|
|
|
ENV GRADIO_PORT=$GRADIO_PORT |
|
ENV MODEL_NAME=$MODEL_NAME |
|
ENV QUANTIZATION=$QUANTIZATION |
|
|
|
RUN echo $QUANTIZATION |
|
|
|
RUN ls -ltr |
|
RUN cat entrypoint.sh.template |
|
RUN export $QUANTIZATION && export $MODEL_NAME && export $QUANTIZATION && \ |
|
envsubst '$GRADIO_PORT, $MODEL_NAME, $QUANTIZATION' < "entrypoint.sh.template" > "entrypoint.sh" |
|
RUN cat entrypoint.sh |
|
|
|
RUN mkdir -p /data/db |
|
RUN chown -R 1000:1000 /data |
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
COPY app app |
|
RUN pip install -r app/requirements.txt |
|
|
|
ENTRYPOINT ["/bin/bash"] |
|
CMD ["entrypoint.sh"] |