Spaces:
Sleeping
Sleeping
File size: 975 Bytes
e136ea6 f47d0d3 6c42c84 f47d0d3 6c42c84 f47d0d3 e136ea6 f52af93 e136ea6 f47d0d3 e136ea6 f52af93 e136ea6 f47d0d3 f52af93 f47d0d3 8e1ead8 e136ea6 f47d0d3 f52af93 e136ea6 f47d0d3 f52af93 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
FROM python:3.9-slim
WORKDIR /app
# Set environment variables early
ENV HOME=/app
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
ENV XDG_CACHE_HOME=/app/.streamlit
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
ffmpeg \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# Create writable cache directories
RUN mkdir -p /app/.cache/huggingface/hub /app/.streamlit && \
chmod -R 777 /app/.cache /app/.streamlit
# Copy Python dependencies
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy application files
COPY app.py ./
COPY utils/ ./utils/
COPY models/ ./models/
COPY .streamlit/ .streamlit/
EXPOSE 8501
# Optional health check for Streamlit
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
# Run the Streamlit app
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|