Spaces:
Sleeping
Sleeping
| # Use official lightweight Python image | |
| FROM python:3.11-slim | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV TF_CPP_MIN_LOG_LEVEL=2 | |
| ENV TF_ENABLE_ONEDNN_OPTS=0 | |
| # Create a working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the model files directly into the image | |
| COPY model/ ./model/ | |
| # Copy your application code | |
| COPY app.py . | |
| # Expose the port Hugging Face expects (7860) | |
| EXPOSE 7860 | |
| # Command to run the application using uvicorn on port 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |