gradio_together_tgi / Dockerfile
chansung's picture
Update Dockerfile
a63e050 verified
raw
history blame
1.16 kB
ARG MODEL_NAME
FROM ghcr.io/huggingface/text-generation-inference:latest
ARG MODEL_NAME
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 mkdir defaults
ADD defaults /defaults
RUN chmod -R 777 /defaults
# && MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS && \
# && MODEL_PROMPT_TEMPLATE="${MODEL_PROMPT_TEMPLATE:="$(cat /defaults/MODEL_PROMPT_TEMPLATE)"}" && export MODEL_PROMPT_TEMPLATE && \
RUN MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME && \
envsubst < "entrypoint.sh.template" > "entrypoint.sh" \
&& rm entrypoint.sh.template
# RUN mkdir /app
# RUN chown -R 1000:1000 /app
RUN mkdir -p /data/db
RUN chown -R 1000:1000 /data
RUN useradd -m -u 1000 user
# Switch to the "user" 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"]