Spaces:
Sleeping
Sleeping
File size: 920 Bytes
204b19c d67ae34 204b19c d67ae34 204b19c d67ae34 204b19c d67ae34 204b19c d67ae34 204b19c d67ae34 204b19c d67ae34 204b19c d67ae34 204b19c d67ae34 204b19c d67ae34 07f0cfd | 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 | # Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# FIX: Use 'libgl1' instead of the deprecated 'libgl1-mesa-glx'
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
build-essential \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create necessary folders and set permissions
RUN mkdir -p uploads models templates
RUN chmod 777 uploads
# Copy the rest of the application
COPY app.py .
COPY templates/index.html ./templates/
# Note: Ensure you upload your model files to the /models folder in your HF Repo
COPY models/ ./models/
# Hugging Face Spaces run on port 7860
EXPOSE 7860
# Run the application
CMD ["python", "app.py"] |