Spaces:
Sleeping
Sleeping
# Use an official Python runtime as a parent image | |
FROM python:3.10-slim | |
# Set environment variables with correct syntax | |
ENV PYTHONDONTWRITEBYTECODE=1 | |
ENV PYTHONUNBUFFERED=1 | |
# Set the Hugging Face home directory to a writable location | |
ENV HF_HOME=/app/cache | |
# Create the cache directory with proper permissions | |
RUN mkdir -p /app/cache && chown -R 1000:1000 /app/cache | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy the application code into the container | |
COPY . /app/ | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
libgl1-mesa-glx && \ | |
apt-get clean && rm -rf /var/lib/apt/lists/* | |
# Install Python dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Expose the port that Streamlit runs on | |
EXPOSE 8501 | |
# Command to run the application | |
CMD ["streamlit", "run", "main.py", "--server.port=7860", "--server.enableCORS=false"] |