Spaces:
Paused
Paused
FROM python:3.9-slim | |
# Set working directory | |
WORKDIR /app | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
git \ | |
curl \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Create /app and give ownership to the typical HF Spaces user (uid 1000) | |
# Also allow read/write/execute for all users (just for runtime flexibility) | |
RUN mkdir -p /app && chown -R 1000:1000 /app && chmod -R a+rw /app | |
# Copy requirements first (for better caching) | |
COPY requirements.txt . | |
# Install Python dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy all app files into container | |
COPY . . | |
# Make setup.sh executable | |
RUN chmod +x setup.sh | |
# Run setup.sh at build time so models are preloaded | |
RUN ./setup.sh | |
# Expose Streamlit port | |
EXPOSE 7860 | |
# Run Streamlit app | |
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"] | |