|
FROM python:3.9-slim |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN mkdir -p /tmp/huggingface/hub \ |
|
&& mkdir -p /tmp/pretrained_models \ |
|
&& mkdir -p /app/.streamlit \ |
|
&& chmod -R 777 /tmp/huggingface \ |
|
&& chmod -R 777 /tmp/pretrained_models \ |
|
&& chmod -R 777 /app/. |
|
|
|
|
|
ENV TRANSFORMERS_CACHE=/tmp/huggingface |
|
ENV HF_HOME=/tmp/huggingface |
|
ENV XDG_CACHE_HOME=/app/.streamlit |
|
ENV HOME=/app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
build-essential \ |
|
ffmpeg \ |
|
curl \ |
|
software-properties-common \ |
|
git \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt ./ |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY app.py ./ |
|
COPY utils/ ./utils/ |
|
COPY models/ ./models/ |
|
COPY .streamlit/ .streamlit/ |
|
|
|
|
|
RUN chmod -R 777 /tmp/huggingface \ |
|
&& chmod -R 777 /tmp/pretrained_models \ |
|
&& chmod -R 777 /app/.streamlit |
|
|
|
EXPOSE 8501 |
|
|
|
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1 |
|
|
|
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] |
|
|